3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public readonly int $bar; public function __set($name, $value) { echo "__set($name, $value)\n"; } public function unsetBar() { unset($this->bar); } } $foo = new Foo(); try { $foo->bar = 42; } catch (Throwable $e) { echo $e->getMessage(), "\n"; } $foo->unsetBar(); $foo->bar = 42;
Output for git.master, git.master_jit
Cannot initialize readonly property Foo::$bar from global scope __set(bar, 42)

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:
145.89 ms | 1394 KiB | 9 Q