using empty on inaccessible object with __isset and __get
- by David
<?php
class Magic_Methods
{
protected $meta;
public function __construct()
{
$this->meta = (object) array(
'test' => 1
);
}
public function __isset($name)
{
echo "pass isset {$name} \n";
return isset($this->$name);
}
public function __get($name)
{
…