3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { protected $_vars = array(); public function __get($var) { echo "__get called\n"; return $this->_vars[$var]; } public function __set($var, $val) { echo "__set called\n"; $this->_vars[$var] = $val; } public function __isset($var) { echo "__isset called\n"; return isset($this->_vars[$var]); } } $o = new A(); $o->a = 1; $o->b = 2; $c = $o->b = 3; var_dump($c); //3 var_dump($o->b); //3 var_dump(empty($o->b));
Output for git.master, git.master_jit, rfc.property-hooks
__set called __set called __set called int(3) __get called int(3) __isset called __get called bool(false)

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:
30.89 ms | 401 KiB | 8 Q