3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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
Jump found. Position 1 = -2
filename:       /in/9XUBC
function name:  (null)
number of ops:  17
compiled vars:  !0 = $a
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   NOP                                                      
  15     1        ASSIGN                                                   !0, 0
  16     2        FETCH_RW                     global              $2      'GLOBALS'
         3        FETCH_DIM_RW                                     $3      $2, 'a'
         4        POST_INC                                         ~4      $3
         5        FREE                                                     ~4
  17     6        INIT_FCALL                                               'debug_zval_dump'
         7        SEND_VAR                                                 !0
         8        DO_ICALL                                                 
  18     9        INIT_FCALL                                               'test'
        10        SEND_VAR                                                 !0
        11        DO_FCALL                                      0          
  19    12        FETCH_R                      global              $7      'GLOBALS'
        13        FETCH_DIM_R                                      $8      $7, 'a'
        14        ECHO                                                     $8
  20    15        ECHO                                                     !0
        16      > RETURN                                                   1

Function test:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/9XUBC
function name:  test
number of ops:  13
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        POST_INC                                         ~3      $2
         4        FREE                                                     ~3
   8     5        INIT_FCALL                                               'debug_zval_dump'
         6        SEND_VAR                                                 !0
         7        DO_ICALL                                                 
  10     8        ECHO                                                     !0
  11     9        FETCH_R                      global              $5      'GLOBALS'
        10        FETCH_DIM_R                                      $6      $5, 'a'
        11        ECHO                                                     $6
  13    12      > RETURN                                                   null

End of function test

Generated using Vulcan Logic Dumper, using php 7.2.0