3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function foo($foo) { $foo->bar++; return $foo; } var_dump(foo($foo));
Output for 5.5.0 - 7.1.0
Notice: Undefined variable: foo in /in/MrY1n on line 6 Warning: Creating default object from empty value in /in/MrY1n on line 3 Notice: Undefined property: stdClass::$bar in /in/MrY1n on line 3 object(stdClass)#1 (1) { ["bar"]=> int(1) }
Output for 5.4.0 - 5.4.45
Notice: Undefined variable: foo in /in/MrY1n on line 6 Warning: Creating default object from empty value in /in/MrY1n on line 3 object(stdClass)#1 (1) { ["bar"]=> int(1) }
Output for 5.0.4 - 5.3.29
Notice: Undefined variable: foo in /in/MrY1n on line 6 Strict Standards: Creating default object from empty value in /in/MrY1n on line 3 object(stdClass)#1 (1) { ["bar"]=> int(1) }
Output for 5.0.0 - 5.0.3
Notice: Undefined variable: foo in /in/MrY1n on line 6 Strict Standards: Creating default object from empty value in /in/MrY1n on line 3 object(stdClass)#1 (1) { ["bar"]=> int(1) }
Output for 4.3.0 - 4.4.9
Notice: Undefined variable: foo in /in/MrY1n on line 6 Notice: Undefined property: bar in /in/MrY1n on line 3 object(stdClass)(1) { ["bar"]=> int(1) }