3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Everything you enter here will be executed by our servers. Try it! $q1 = 1; $q2 = 2; $q3 = 3; $q4 = 4; $q5 = 5; echo "${q1}"; //outputs 1 for($i=1; $i<=5; $i++) { echo "${q$i}"; //how to make $i work here? }
Output for 5.4.0 - 5.4.17
Parse error: syntax error, unexpected '$i' (T_VARIABLE) in /in/9O5qK on line 14
Process exited with code 255.
Output for 5.3.0 - 5.3.27
Parse error: syntax error, unexpected T_VARIABLE in /in/9O5qK on line 14
Process exited with code 255.

preferences:
179.25 ms | 1395 KiB | 53 Q