3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Cl { public string $name; public function __get(string $n): void { var_dump('__get: ' . $n); } } $obj = new Cl(); // read on uninitialized typed property try { $obj->name; } catch (\Error $e) { echo $e->getMessage() . "\n"; } // read on unset typed property unset($obj->name); try { $obj->name; } catch (\Error $e) { echo $e->getMessage() . "\n"; }
Output for git.master, git.master_jit, rfc.property-hooks
Typed property Cl::$name must not be accessed before initialization string(11) "__get: name" Value of type null returned from Cl::__get() must be compatible with unset property Cl::$name of type string

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:
73.06 ms | 405 KiB | 5 Q