3v4l.org

run code in 500+ PHP versions simultaneously
<?php abstract class BaseLevel { public string $name { set => strtolower($value); } abstract public function getName(): string; } class FirstLevel extends BaseLevel { public function getName(): string { return ucfirst($this->name); } } class SecondLevel extends FirstLevel { public function getName(): string { return strtoupper($this->name); } } $firstLevel = new FirstLevel(); $firstLevel->name = 'John'; echo $firstLevel->name; echo $firstLevel->getName(); $secondLevel = new SecondLevel(); # $secondLevel->name = 'Jane'; echo $secondLevel->name; echo $secondLevel->getName();
Output for git.master_jit
johnJohn Fatal error: Uncaught Error: Typed property BaseLevel::$name must not be accessed before initialization in /in/Tnb34:29 Stack trace: #0 {main} thrown in /in/Tnb34 on line 29
Process exited with code 255.
Output for git.master

Process exited with code 139.

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:
40.1 ms | 493 KiB | 3 Q