3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = 1; function f1() { $b = 2; function f2() { global $a, $b; var_dump($a, $b); } f2(); } f1();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HPoWM
function name:  (null)
number of ops:  4
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 1
   16     1        INIT_FCALL                                               'f1'
          2        DO_FCALL                                      0          
          3      > RETURN                                                   1

Function f1:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HPoWM
function name:  f1
number of ops:  5
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ASSIGN                                                   !0, 2
    7     1        DECLARE_FUNCTION                                         'f2'
   13     2        INIT_FCALL_BY_NAME                                       'f2'
          3        DO_FCALL                                      0          
   14     4      > RETURN                                                   null

End of function f1

Function %00f2%2Fin%2FHPoWM%3A7%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HPoWM
function name:  f2
number of ops:  7
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   BIND_GLOBAL                                              !0, 'a'
          1        BIND_GLOBAL                                              !1, 'b'
   10     2        INIT_FCALL                                               'var_dump'
          3        SEND_VAR                                                 !0
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                                 
   11     6      > RETURN                                                   null

End of function %00f2%2Fin%2FHPoWM%3A7%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.64 ms | 1397 KiB | 16 Q