3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Math { public int $x; public int $y; public function __construct($x, $y) { $this->x = $x; $this->y = $y; } public function add() { return $this->x + $this->y; } public function __set($key, $val) { $this->x = $val; } } $math = new Math(5,10); unset($math->x); echo $math->add();
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Typed property Math::$x must not be accessed before initialization in /in/PrMAQ:13 Stack trace: #0 /in/PrMAQ(25): Math->add() #1 {main} thrown in /in/PrMAQ on line 13
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:
80.84 ms | 1595 KiB | 4 Q