3v4l.org

run code in 300+ PHP versions simultaneously
<?php ini_set("display_errors", 1); error_reporting(E_ALL | E_STRICT); 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");

preferences:
68.99 ms | 402 KiB | 5 Q