3v4l.org

run code in 300+ PHP versions simultaneously
<?php $derp = new bar(); function foo() { global $derp; return $derp; } class bar { public $baz = array( 'lol' ); } echo foo()->baz[0] . "\n"; foo()->baz[] = 'cheese'; echo foo()->baz[1];
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TfYsk
function name:  (null)
number of ops:  21
compiled vars:  !0 = $derp
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $1      'bar'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   14     3        INIT_FCALL                                               'foo'
          4        DO_FCALL                                      0  $4      
          5        FETCH_OBJ_R                                      ~5      $4, 'baz'
          6        FETCH_DIM_R                                      ~6      ~5, 0
          7        CONCAT                                           ~7      ~6, '%0A'
          8        ECHO                                                     ~7
   15     9        INIT_FCALL                                               'foo'
         10        DO_FCALL                                      0  $8      
         11        SEPARATE                                         $8      $8
         12        FETCH_OBJ_W                                      $9      $8, 'baz'
         13        ASSIGN_DIM                                               $9
         14        OP_DATA                                                  'cheese'
   16    15        INIT_FCALL                                               'foo'
         16        DO_FCALL                                      0  $11     
         17        FETCH_OBJ_R                                      ~12     $11, 'baz'
         18        FETCH_DIM_R                                      ~13     ~12, 1
         19        ECHO                                                     ~13
         20      > RETURN                                                   1

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

End of function foo

Class bar: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.17 ms | 1398 KiB | 16 Q