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();

preferences:
55.86 ms | 756 KiB | 5 Q