3v4l.org

run code in 300+ PHP versions simultaneously
<?php function func () { static $loc = 0; global $globA; global $globB; $globA = $loc; $globB =& $loc; $loc++; } $globA = null; $globB = null; func(); var_dump($globA); var_dump($globB); func(); var_dump($globA); var_dump($globB); func(); var_dump($globA); var_dump($globB); func(); var_dump($globA); var_dump($globB);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jOYBW
function name:  (null)
number of ops:  35
compiled vars:  !0 = $globA, !1 = $globB
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   ASSIGN                                                   !0, null
   16     1        ASSIGN                                                   !1, null
   18     2        INIT_FCALL                                               'func'
          3        DO_FCALL                                      0          
   19     4        INIT_FCALL                                               'var_dump'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                                 
   20     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                                 
   22    10        INIT_FCALL                                               'func'
         11        DO_FCALL                                      0          
   23    12        INIT_FCALL                                               'var_dump'
         13        SEND_VAR                                                 !0
         14        DO_ICALL                                                 
   24    15        INIT_FCALL                                               'var_dump'
         16        SEND_VAR                                                 !1
         17        DO_ICALL                                                 
   26    18        INIT_FCALL                                               'func'
         19        DO_FCALL                                      0          
   27    20        INIT_FCALL                                               'var_dump'
         21        SEND_VAR                                                 !0
         22        DO_ICALL                                                 
   28    23        INIT_FCALL                                               'var_dump'
         24        SEND_VAR                                                 !1
         25        DO_ICALL                                                 
   30    26        INIT_FCALL                                               'func'
         27        DO_FCALL                                      0          
   31    28        INIT_FCALL                                               'var_dump'
         29        SEND_VAR                                                 !0
         30        DO_ICALL                                                 
   32    31        INIT_FCALL                                               'var_dump'
         32        SEND_VAR                                                 !1
         33        DO_ICALL                                                 
         34      > RETURN                                                   1

Function func:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jOYBW
function name:  func
number of ops:  7
compiled vars:  !0 = $loc, !1 = $globA, !2 = $globB
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   BIND_STATIC                                              !0
    6     1        BIND_GLOBAL                                              !1, 'globA'
    7     2        BIND_GLOBAL                                              !2, 'globB'
    9     3        ASSIGN                                                   !1, !0
   10     4        ASSIGN_REF                                               !2, !0
   12     5        PRE_INC                                                  !0
   13     6      > RETURN                                                   null

End of function func

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.19 ms | 1005 KiB | 18 Q