<?php
class A {
public static function test(string $s, int $i, mixed $m) {}
}
class B extends A {
public static function test($s, $i, $m) {
var_dump($s, $i, $m);
}
}
B::test('string', 1, NULL);
Warning: Declaration of B::test($s, $i, $m) should be compatible with A::test(string $s, int $i, mixed $m) in /in/LdCsl on line 11
string(6) "string"
int(1)
NULL
Strict Standards: Declaration of B::test() should be compatible with A::test(string $s, int $i, mixed $m) in /in/LdCsl on line 11
string(6) "string"
int(1)
NULL
Strict Standards: Declaration of B::test() should be compatible with that of A::test() in /in/LdCsl on line 11
string(6) "string"
int(1)
NULL
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/LdCsl on line 4
Process exited with code 255.
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/LdCsl on line 4
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/LdCsl on line 4
Process exited with code 255.