3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test($var) { $GLOBALS['a']++; //$var++; debug_zval_dump($var); //$GLOBALS['var']++; echo $var; echo $GLOBALS['a']; // echo $GLOBALS['var']; } $a = 0; $GLOBALS['a']++; debug_zval_dump($a); test($a); echo $GLOBALS['a']; echo $a;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9XUBC
function name:  (null)
number of ops:  15
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   ASSIGN                                                   !0, 0
   16     1        FETCH_RW                     global              $2      'GLOBALS'
          2        FETCH_DIM_RW                                     $3      $2, 'a'
          3        PRE_INC                                                  $3
   17     4        INIT_FCALL                                               'debug_zval_dump'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                                 
   18     7        INIT_FCALL                                               'test'
          8        SEND_VAR                                                 !0
          9        DO_FCALL                                      0          
   19    10        FETCH_R                      global              ~7      'GLOBALS'
         11        FETCH_DIM_R                                      ~8      ~7, 'a'
         12        ECHO                                                     ~8
   20    13        ECHO                                                     !0
         14      > RETURN                                                   1

Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9XUBC
function name:  test
number of ops:  12
compiled vars:  !0 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        FETCH_RW                     global              $1      'GLOBALS'
          2        FETCH_DIM_RW                                     $2      $1, 'a'
          3        PRE_INC                                                  $2
    8     4        INIT_FCALL                                               'debug_zval_dump'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                                 
   10     7        ECHO                                                     !0
   11     8        FETCH_R                      global              ~5      'GLOBALS'
          9        FETCH_DIM_R                                      ~6      ~5, 'a'
         10        ECHO                                                     ~6
   13    11      > RETURN                                                   null

End of function test

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.54 ms | 1389 KiB | 16 Q