3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class su{ function sum ($a) { var $b; for($b=2;$b<=$a;$b++) if($a%$b==0) { echo "a"; } else { echo "b"; } $xin = new su; $xin -> sum(5); ?>
Output for 5.4.0 - 5.4.11
Parse error: syntax error, unexpected 'var' (T_VAR) in /in/UK2c7 on line 5
Process exited with code 255.
Output for 5.3.0 - 5.3.21
Parse error: syntax error, unexpected T_VAR in /in/UK2c7 on line 5
Process exited with code 255.