3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function swap(&$a, &$b) { $temp = $a; $a = $b; $b = $temp; } $a = 10; $b = 5; if(a>b) { swap($a, $b); } for($i=$a ; $i<=$b ; $i++) { echo " ".$i." "; }
based on Qq5iX
Output for 7.2.0
Warning: Use of undefined constant a - assumed 'a' (this will throw an Error in a future version of PHP) in /in/qtpX3 on line 13 Warning: Use of undefined constant b - assumed 'b' (this will throw an Error in a future version of PHP) in /in/qtpX3 on line 13
Output for 5.3.20 - 7.1.10
Notice: Use of undefined constant a - assumed 'a' in /in/qtpX3 on line 13 Notice: Use of undefined constant b - assumed 'b' in /in/qtpX3 on line 13