<?php
class A
{
}
class B
{
public function test(A $a) { var_dump($a); }
}
class C extends B
{
public function test($a) { parent::test($a); }
}
$c = new C;
$c->test(new A);
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
object(A)#2 (0) {
}
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.20
Warning: Declaration of C::test($a) should be compatible with B::test(A $a) in /in/93qEQ on line 16
object(A)#2 (0) {
}
Output for 5.5.24 - 5.5.35, 5.6.8 - 5.6.28
Strict Standards: Declaration of C::test() should be compatible with B::test(A $a) in /in/93qEQ on line 16
object(A)#2 (0) {
}