<?php
declare(scalar_types=1);
class A {
public function foo(int $a, float $b) { }
}
class B extends A {
public function foo($a, $b) { }
}
$b = new B();
$b->foo('1', '2');
Warning: Unsupported declare 'scalar_types' in /in/h7lft on line 2
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.33
Warning: Unsupported declare 'scalar_types' in /in/h7lft on line 2
Warning: Declaration of B::foo($a, $b) should be compatible with A::foo(int $a, float $b) in /in/h7lft on line 9
Warning: Unsupported declare 'scalar_types' in /in/h7lft on line 2
Strict Standards: Declaration of B::foo() should be compatible with A::foo(int $a, float $b) in /in/h7lft on line 9
Output for 5.3.0 - 5.3.29
Warning: Unsupported declare 'scalar_types' in /in/h7lft on line 2
Strict Standards: Declaration of B::foo() should be compatible with that of A::foo() in /in/h7lft on line 9
Strict Standards: Declaration of B::foo() should be compatible with that of A::foo() in /in/h7lft on line 9
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/h7lft 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/h7lft 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/h7lft on line 4
Process exited with code 255.