3v4l.org

run code in 500+ PHP versions simultaneously
<?php $test = 'hello'; function test() { $vars = ['test']; foreach ($vars as $var) { global $$var; } echo $test; } test();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rH8J0
function name:  (null)
number of ops:  4
compiled vars:  !0 = $test
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, 'hello'
   13     1        INIT_FCALL                                                   'test'
          2        DO_FCALL                                          0          
          3      > RETURN                                                       1

Function test:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 7
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 7
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
filename:       /in/rH8J0
function name:  test
number of ops:  10
compiled vars:  !0 = $vars, !1 = $var, !2 = $test
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    6     0  E >   ASSIGN                                                       !0, <array>
    7     1      > FE_RESET_R                                           $4      !0, ->7
          2    > > FE_FETCH_R                                                   $4, !1, ->7
    8     3    >   FETCH_W                          global lock         $5      !1
          4        FETCH_W                          local               $6      !1
          5        ASSIGN_REF                                                   $6, $5
    7     6      > JMP                                                          ->2
          7    >   FE_FREE                                                      $4
   10     8        ECHO                                                         !2
   11     9      > RETURN                                                       null

End of function test

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
210.47 ms | 2124 KiB | 14 Q