3v4l.org

run code in 300+ PHP versions simultaneously
<?php class TestKey { private $data = array(); public function __set($name, $value) { $this->data[$name] = $value; } public function __get($name) { return @$this->data[$name]; } /** As of PHP 5.1.0 */ public function __isset($name) { // does not matter if (array_key_exists($name, $this->data)) { return true; } return false; } /** As of PHP 5.1.0 */ public function __unset($name) { unset($this->data[$name]); } } class TestValue { private $data = array(); public function __set($name, $value) { $this->data[$name] = $value; } public function __get($name) { return @$this->data[$name]; } /** As of PHP 5.1.0 */ public function __isset($name) { return isset($this->data[$name]); } /** As of PHP 5.1.0 */ public function __unset($name) { $this->data[$name] = null; } } $k = new TestKey(); $v = new TestValue(); $k->foo = $v->foo = "bar"; var_dump(isset($k->foo) === isset($v->foo)); $k->foo = $v->foo = null; var_dump(isset($k->foo) === isset($v->foo)); unset($k->foo, $v->foo); var_dump(isset($k->foo) === isset($v->foo));
Output for git.master, git.master_jit, rfc.property-hooks
bool(true) bool(false) bool(true)

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
43.8 ms | 401 KiB | 8 Q