3v4l.org

run code in 300+ PHP versions simultaneously
<?php if (1==1) { $sql = "some sql statement $tmp[id]"; echo $sql; } //^ that is not working $sql prints as empty but if I do : if (1==1) { $anything = $tmp['id']; $sql = "some sql statement $tmp[id]"; echo $sql; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 1, Position 2 = 6
Branch analysis from position: 1
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 14
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
Branch analysis from position: 6
filename:       /in/sKZEI
function name:  (null)
number of ops:  15
compiled vars:  !0 = $sql, !1 = $tmp, !2 = $anything
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E > > JMPZ                                                     <true>, ->6
    3     1    >   NOP                                                      
          2        FETCH_DIM_R                                      ~3      !1, 'id'
          3        FAST_CONCAT                                      ~4      'some+sql+statement+', ~3
          4        ASSIGN                                                   !0, ~4
    4     5        ECHO                                                     !0
    9     6    > > JMPZ                                                     <true>, ->14
   10     7    >   FETCH_DIM_R                                      ~6      !1, 'id'
          8        ASSIGN                                                   !2, ~6
   11     9        NOP                                                      
         10        FETCH_DIM_R                                      ~8      !1, 'id'
         11        FAST_CONCAT                                      ~9      'some+sql+statement+', ~8
         12        ASSIGN                                                   !0, ~9
   12    13        ECHO                                                     !0
   13    14    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.46 ms | 1393 KiB | 13 Q