3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Foo { public int $bar { get => $this->bar; set => empty($this->bar) ? $this->bar = $value : throw new LogicException("nope"); } } $foo = new Foo(); $foo->bar = 42; echo $foo->bar . "\n"; $foo->bar += 1;
Output for git.master_jit, git.master
42 Fatal error: Uncaught LogicException: nope in /in/2JagR:6 Stack trace: #0 /in/2JagR(14): Foo->$bar::set(43) #1 {main} thrown in /in/2JagR on line 6
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:
37.7 ms | 493 KiB | 3 Q