3v4l.org

run code in 500+ PHP versions simultaneously
<?php class x { function foo(int $a, int ...$args) {} } class y extends x { function foo( int ...$args) {} } // OK! //class z extends x { function foo(int $a, int $b, int ...$args) {} } // KO class x2 { function foo() {} } class y2 extends x2 { function foo(mixed ...$args) {} } // OK! //class y22 extends x2 { function foo(mixed $a, mixed ...$args) {} } // KO class x4 { function foo($a, $b) {} } class y4 extends x4 { function foo($b, $c, $d) {} } // OK! //class y22 extends x2 { function foo(mixed $a, mixed ...$args) {} } // KO class x3 { function foo(mixed ...$args) {} } //class y3 extends x3 { function foo() {} } // KO //class y32 extends x3 { function foo(mixed $a) {} } // KOx class x4 { function foo(int $a, int $b) {} } class y4 extends x4 { function foo(int $b, int $a) {} } // KO
Output for git.master_jit
Fatal error: Declaration of y4::foo($b, $c, $d) must be compatible with x4::foo($a, $b) in /in/6kQRu on line 12 Stack trace: #0 {main}
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:
26.75 ms | 493 KiB | 3 Q