3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types = 1); class parent_ { public function __construct(){ } public static function createNew(): static{ return new static(); } } class child extends parent_ { public function __construct(int $a){ echo $a; } } child::createNew();
Output for rfc.property-hooks, git.master, git.master_jit
Fatal error: Uncaught ArgumentCountError: Too few arguments to function child::__construct(), 0 passed in /in/cG5Am on line 10 and exactly 1 expected in /in/cG5Am:16 Stack trace: #0 /in/cG5Am(10): child->__construct() #1 /in/cG5Am(21): parent_::createNew() #2 {main} thrown in /in/cG5Am 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:
46.23 ms | 1061 KiB | 4 Q