3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A {} class Test { //public function hello(A $a, $hi) public function hello($hi) { echo "Hi!\n"; } } class Child extends Test { public function hello(A $a, $hi) { echo "Hi!\n"; } } $test = new Test; $child = new Child; $a = new A; $test->hello($a, "Hi"); // Original signature $test->hello("Hi"); // Modified signature $child->hello($a, "Hi"); // Original signature $child->hello($a, "Hi"); // Child extending original signature $child->hello($a, "a", A::class, "Hi", 1, 2, 3, "no php doesn't do strict checks on user functions");
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Declaration of Child::hello(A $a, $hi) must be compatible with Test::hello($hi) in /in/VvNKc 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:
58.23 ms | 401 KiB | 8 Q