3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class A { public function __construct($a, $b = null, $c = '/', $d = 1, $e = 0) { var_dump($a); var_dump($b); var_dump($c); var_dump($d); var_dump($e); } } $a = new A('foo'); $b = new A(null); $c = new A('foo',null,null,null,null); $d = new A('bar',null,null,null,'z');
Output for 5.0.0 - 7.2.0
string(3) "foo" NULL string(1) "/" int(1) int(0) NULL NULL string(1) "/" int(1) int(0) string(3) "foo" NULL NULL NULL NULL string(3) "bar" NULL NULL NULL string(1) "z"
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/8SAZT on line 4
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/8SAZT 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/8SAZT on line 4
Process exited with code 255.