3v4l.org

run code in 300+ PHP versions simultaneously
<?php $size = 4;//number of inputs $output = []; for($i=1;$i<$size;$i++){ for($j=$i+1;$j<=$size;$j++){ $output[] = "Input: $i-$j \n"; } } echo implode("",$output);
Output for 5.6.0 - 5.6.23, 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.16 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.25, 8.4.1 - 8.4.12
Input: 1-2 Input: 1-3 Input: 1-4 Input: 2-3 Input: 2-4 Input: 3-4

preferences:
153.39 ms | 408 KiB | 5 Q