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++) { $varname = "q{$i}"; echo $$varname; //how to make $i work here? }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 9
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 9
Branch analysis from position: 17
Branch analysis from position: 9
filename:       /in/pUKgI
function name:  (null)
number of ops:  18
compiled vars:  !0 = $q1, !1 = $q2, !2 = $q3, !3 = $q4, !4 = $q5, !5 = $i, !6 = $varname
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, 1
    5     1        ASSIGN                                                   !1, 2
    6     2        ASSIGN                                                   !2, 3
    7     3        ASSIGN                                                   !3, 4
    8     4        ASSIGN                                                   !4, 5
   10     5        CAST                                          6  ~12     !0
          6        ECHO                                                     ~12
   12     7        ASSIGN                                                   !5, 1
          8      > JMP                                                      ->15
   14     9    >   NOP                                                      
         10        FAST_CONCAT                                      ~14     'q', !5
         11        ASSIGN                                                   !6, ~14
   15    12        FETCH_R                      local               ~16     !6
         13        ECHO                                                     ~16
   12    14        PRE_INC                                                  !5
         15    >   IS_SMALLER_OR_EQUAL                                      !5, 5
         16      > JMPNZ                                                    ~18, ->9
   16    17    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.66 ms | 1393 KiB | 13 Q