3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private int $foo = 123; private array $bar = ['a' => 'b']; public function & __get(string $name) { return $this->$name; } } $foo = new Foo; var_dump($foo); $foo->foo = 456; $foo->bar['c'] = 'd'; var_dump($foo);
Output for git.master, git.master_jit, rfc.property-hooks
object(Foo)#1 (2) { ["foo":"Foo":private]=> int(123) ["bar":"Foo":private]=> array(1) { ["a"]=> string(1) "b" } } Fatal error: Uncaught Error: Cannot access private property Foo::$foo in /in/dn1cQ:17 Stack trace: #0 {main} thrown in /in/dn1cQ on line 17
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:
128.69 ms | 406 KiB | 5 Q