3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class PropertyTest { private $data = array(); public function __set($name, $value) { echo "Setting '$name' to '$value'\n"; $this->data[$name] = $value; } public function __get($name) { echo "Getting '$name'\n"; if (array_key_exists($name, $this->data)) { return $this->data[$name]; }} } echo "<pre>\n"; $obj = new PropertyTest; $obj->a = 1; echo $obj->a . "\n\n"; var_dump(isset($obj->a)); unset($obj->a); ?>
Output for 5.3.0 - 5.4.45
<pre> Setting 'a' to '1' Getting 'a' 1 bool(false)