3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo() { $x = array(1,2,3,4,5,6); var_dump(current($x)); var_dump(next($x)); var_dump(next($x)); var_dump(current($x)); foreach ($x as $y) {echo "GOT: $y\n";} var_dump(current($x)); } foo();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/eb36s
function name:  (null)
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   INIT_FCALL                                               'foo'
          1        DO_FCALL                                      0          
          2      > RETURN                                                   1

Function foo:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 26, Position 2 = 32
Branch analysis from position: 26
2 jumps found. (Code = 78) Position 1 = 27, Position 2 = 32
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 32
filename:       /in/eb36s
function name:  foo
number of ops:  40
compiled vars:  !0 = $x, !1 = $y
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        INIT_FCALL                                               'var_dump'
          2        INIT_FCALL                                               'current'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $3      
          5        SEND_VAR                                                 $3
          6        DO_ICALL                                                 
    5     7        INIT_FCALL                                               'var_dump'
          8        INIT_FCALL                                               'next'
          9        SEND_REF                                                 !0
         10        DO_ICALL                                         $5      
         11        SEND_VAR                                                 $5
         12        DO_ICALL                                                 
    6    13        INIT_FCALL                                               'var_dump'
         14        INIT_FCALL                                               'next'
         15        SEND_REF                                                 !0
         16        DO_ICALL                                         $7      
         17        SEND_VAR                                                 $7
         18        DO_ICALL                                                 
    7    19        INIT_FCALL                                               'var_dump'
         20        INIT_FCALL                                               'current'
         21        SEND_VAR                                                 !0
         22        DO_ICALL                                         $9      
         23        SEND_VAR                                                 $9
         24        DO_ICALL                                                 
    8    25      > FE_RESET_R                                       $11     !0, ->32
         26    > > FE_FETCH_R                                               $11, !1, ->32
         27    >   ROPE_INIT                                     3  ~13     'GOT%3A+'
         28        ROPE_ADD                                      1  ~13     ~13, !1
         29        ROPE_END                                      2  ~12     ~13, '%0A'
         30        ECHO                                                     ~12
         31      > JMP                                                      ->26
         32    >   FE_FREE                                                  $11
    9    33        INIT_FCALL                                               'var_dump'
         34        INIT_FCALL                                               'current'
         35        SEND_VAR                                                 !0
         36        DO_ICALL                                         $15     
         37        SEND_VAR                                                 $15
         38        DO_ICALL                                                 
   10    39      > RETURN                                                   null

End of function foo

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
179.18 ms | 1403 KiB | 20 Q