3v4l.org

run code in 500+ PHP versions simultaneously
<?php function demo($array) { $debug_backtrace = []; next($array); foreach ($array as $key => &$value) { echo "{$value}\r\n"; if ($value == 3) { unset($array[$key]); continue; } $debug_backtrace[] = debug_backtrace(); } } demo([1, 2, 3]);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tTLCk
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   20     0  E >   INIT_FCALL                                                   'demo'
          1        SEND_VAL                                                     <array>
          2        DO_FCALL                                          0          
          3      > RETURN                                                       1

Function demo:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 125) Position 1 = 6, Position 2 = 20
Branch analysis from position: 6
2 jumps found. (Code = 126) Position 1 = 7, Position 2 = 20
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 15
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
filename:       /in/tTLCk
function name:  demo
number of ops:  22
compiled vars:  !0 = $array, !1 = $debug_backtrace, !2 = $value, !3 = $key
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   RECV                                                 !0      
    4     1        ASSIGN                                                       !1, <array>
    6     2        INIT_FCALL                                                   'next'
          3        SEND_REF                                                     !0
          4        DO_ICALL                                                     
    7     5      > FE_RESET_RW                                          $6      !0, ->20
          6    > > FE_FETCH_RW                                          ~7      $6, !2, ->20
          7    >   ASSIGN                                                       !3, ~7
    8     8        NOP                                                          
          9        FAST_CONCAT                                          ~9      !2, '%0D%0A'
         10        ECHO                                                         ~9
   10    11        IS_EQUAL                                                     !2, 3
         12      > JMPZ                                                         ~10, ->15
   11    13    >   UNSET_DIM                                                    !0, !3
   13    14      > JMP                                                          ->6
   16    15    >   INIT_FCALL                                                   'debug_backtrace'
         16        DO_ICALL                                             $12     
         17        ASSIGN_DIM                                                   !1
         18        OP_DATA                                                      $12
    7    19      > JMP                                                          ->6
         20    >   FE_FREE                                                      $6
   18    21      > RETURN                                                       null

End of function demo

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
130.18 ms | 482 KiB | 10 Q