3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php error_reporting(E_ALL | E_STRICT); class O { protected $x; public function xy() { } } class SO { public function xoapapa() { } } class A { public function one(O $u) { } } class B extends A { public function one(SO $u) { } } $b = new B(); echo 'X';
Output for 7.0.0 - 7.1.0
Warning: Declaration of B::one(SO $u) should be compatible with A::one(O $u) in /in/dA9jp on line 43 X
Output for hhvm-3.10.0 - 3.12.0
X
Output for 5.4.0 - 5.6.28
Strict Standards: Declaration of B::one() should be compatible with A::one(O $u) in /in/dA9jp on line 43 X
Output for 5.0.0 - 5.3.29
Strict Standards: Declaration of B::one() should be compatible with that of A::one() in /in/dA9jp on line 43 X
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/dA9jp on line 7
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/dA9jp on line 7
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/dA9jp on line 7
Process exited with code 255.