Isset always return false for object even they declared

Why isset on object variable always return false even they declared?

Hi gede, welcome to the forums,

Returns TRUE if var exists and has value other than NULL, FALSE otherwise.

if you try something like

$my_obj = new $Object;
echo isset($my_obj);
var_dump($my_obj);

what do you get?

Ahh I see…
I figure out the problem now… the problem is in my class have magic method __get()

class myClass{
var $data = array(‘key’ => 1);
function __get($key)
{
return (isset($this->data[$key])) ? $this->data[$key] : false;
}
}
$my_obj = new myClass();
var_dump(isset($my_obj->key));
echo $my_obj->key;

that make me confused, when I echo it’s return value, but return false from isset()
Does my code normally?