Skip to content
This repository has been archived by the owner on Dec 16, 2019. It is now read-only.

empty() function return false with parameter of Thread empty array member #616

Closed
2bright opened this issue Aug 8, 2016 · 0 comments
Closed

Comments

@2bright
Copy link

2bright commented Aug 8, 2016

Environment

  • PHP: 7.0.7
  • pthreads: 3.1.6
  • OS: ubuntu 14.04

Reproducing Code

<?php
class MyThread extends Thread {
    public function run(){
        $this->arr = (array)[];
        print_r("\$this->arr is " . (empty($this->arr) ? 'empty' : 'not empty') . "\n");
        $arr = (array)[];
        print_r("\$arr is " . (empty($arr) ? 'empty' : 'not empty') . "\n");
    }
}
$thread = new MyThread();
$thread->start();
?>

Expected Output

$this->arr is empty
$arr is empty

Actual Output

$this->arr is not empty
$arr is empty

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant