3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { PRIVATE(set) string $bar1 = ''; public private(SET) string $bar2 = ''; private(set) public string $bar3 = ''; public function __construct( public protected(SET) string $bar4 = '' ) {} } $foo = new Foo(); var_dump($foo); $foo->bar4 = 'test';
Output for git.master_jit
object(Foo)#1 (4) { ["bar1"]=> string(0) "" ["bar2"]=> string(0) "" ["bar3"]=> string(0) "" ["bar4"]=> string(0) "" } Fatal error: Uncaught Error: Cannot modify protected(set) property Foo::$bar4 from global scope in /in/JDXuq:16 Stack trace: #0 {main} thrown in /in/JDXuq on line 16
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:
133.87 ms | 995 KiB | 7 Q