3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = 'a_global'; function foo() { $a = 'a_local'; var_dump($a); static $a; var_dump($a); $a = 'a_static'; var_dump($a); global $a; var_dump($a); } foo(); echo "---\n"; foo();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vPr2A
function name:  (null)
number of ops:  7
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'a_global'
   20     1        INIT_FCALL                                               'foo'
          2        DO_FCALL                                      0          
   21     3        ECHO                                                     '---%0A'
   22     4        INIT_FCALL                                               'foo'
          5        DO_FCALL                                      0          
          6      > RETURN                                                   1

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vPr2A
function name:  foo
number of ops:  17
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   ASSIGN                                                   !0, 'a_local'
    7     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
    9     4        BIND_STATIC                                              !0
   11     5        INIT_FCALL                                               'var_dump'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                                 
   12     8        ASSIGN                                                   !0, 'a_static'
   13     9        INIT_FCALL                                               'var_dump'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                                 
   15    12        BIND_GLOBAL                                              !0, 'a'
   17    13        INIT_FCALL                                               'var_dump'
         14        SEND_VAR                                                 !0
         15        DO_ICALL                                                 
   18    16      > RETURN                                                   null

End of function foo

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.11 ms | 1006 KiB | 16 Q