@ 2020-10-28T14:53:06Z <?php
class A {
public function xx(int $a, float $b)
{
print_r(func_get_args());
}
}
class B extends A {
public function xx(int $a, float $b)
{
throw new Error('Not allowed');
}
}
$a = new A();
$a->xx(1, 2);
$b = new B();
$b->xx(1, 2);
Enable javascript to submit You have javascript disabled. You will not be able to edit any code.
Output for 8.1.0 - 8.1.33 , 8.2.0 - 8.2.29 , 8.3.0 - 8.3.25 , 8.4.1 - 8.4.12 Array
(
[0] => 1
[1] => 2
)
Fatal error: Uncaught Error: Not allowed in /in/3m7eo:13
Stack trace:
#0 /in/3m7eo(21): B->xx(1, 2.0)
#1 {main}
thrown in /in/3m7eo on line 13
Process exited with code 255 . Output for 7.2.0 - 7.2.34 , 7.3.0 - 7.3.33 , 7.4.0 - 7.4.33 , 8.0.0 - 8.0.30 Array
(
[0] => 1
[1] => 2
)
Fatal error: Uncaught Error: Not allowed in /in/3m7eo:13
Stack trace:
#0 /in/3m7eo(21): B->xx(1, 2)
#1 {main}
thrown in /in/3m7eo on line 13
Process exited with code 255 . preferences:dark mode live preview ace vim emacs key bindings
48.58 ms | 408 KiB | 5 Q