3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class CarPrototype { protected $doors; protected $wheels; abstract function __clone(); function getDoors() { return $this->doors; } function setDoors($doors) { $this->doors = $doors; } function __toString() { echo $this->doors . ' ' . $this->wheels; } } class NormalCarPrototype extends CarPrototype { function __construct() { $this->doors = 4; $this->wheels = 4; } function __clone() { } } $car = new NormalCarPrototype(); $sandero = clone $car; $duster = clone $car; echo $sandero;
Output for git.master, git.master_jit, rfc.property-hooks
4 4 Fatal error: Uncaught TypeError: CarPrototype::__toString(): Return value must be of type string, none returned in /in/72JKM:19 Stack trace: #0 /in/72JKM(37): CarPrototype->__toString() #1 {main} thrown in /in/72JKM on line 19
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:
70.73 ms | 401 KiB | 8 Q