3v4l.org

run code in 500+ PHP versions simultaneously
<?php class X { protected string $foo; public function __isset($name) { echo "DONT YOU SEE THAT THIS IS CALLED THE `FALSE` ISSNT BECAUSE ISSET() WORKS, ITS THE ISSET UNDER THAT LINE WORKS\n"; // return isset($this->foo); // But this doesn't call __isset. Even it is the same like this in line 18. return true; } public function test_isset() { var_dump(isset($this->foo)); // Is false always unset($this->foo); var_dump(isset($this->foo)); // This should be false, but it calls __isset(). } } $x = new X(); var_dump(isset($x->foo)); unset($x->foo); var_dump(isset($x->foo)); (new X())->test_isset();
Output for git.master_jit, git.master
DONT YOU SEE THAT THIS IS CALLED THE `FALSE` ISSNT BECAUSE ISSET() WORKS, ITS THE ISSET UNDER THAT LINE WORKS bool(true) Fatal error: Uncaught Error: Cannot access protected property X::$foo in /in/Rmvuk:23 Stack trace: #0 {main} thrown in /in/Rmvuk on line 23
Process exited with code 255.

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:
53.9 ms | 755 KiB | 4 Q