3v4l.org

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

Function f:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LNDd4
function name:  f
number of ops:  11
compiled vars:  !0 = $x, !1 = $y
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   BIND_GLOBAL                                              !0, 'x'
    5     1        ASSIGN                                                   !1, !0
    6     2        INIT_FCALL_BY_NAME                                       'g'
          3        DO_FCALL                                      0          
    7     4        INIT_FCALL                                               'var_dump'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                                 
    8     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                                 
    9    10      > RETURN                                                   null

End of function f

Function g:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LNDd4
function name:  g
number of ops:  3
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   BIND_GLOBAL                                              !0, 'x'
   13     1        ASSIGN                                                   !0, 2
   14     2      > RETURN                                                   null

End of function g

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.42 ms | 1398 KiB | 16 Q