I am within a class. I try to set an object member:
$this->list = "hello";
print $this->list;
It returns "hello";
However, empty($this->list)) always return true.
But for non object member $tmp = "hello", empty($tmp) return false.
Why empty() cannot be used on object member?
Update: empty() is influenced by the the my code framework. That is why it does not work properly.
$this->list = 'hello'? Are you getting any error messages?$s = new stdClass; $s->list = 'Hello'; var_dump($s); /* object(stdClass)#1 (1) { ["list"]=> string(5) "Hello" } */ var_dump(empty($s->list)); /* bool(false) */