3v4l.org

run code in 300+ PHP versions simultaneously
<?php $db = (object)array('prop' => 'Hello World'); function & test() { global $db; return $db; } echo test()->prop;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/elQi1
function name:  (null)
number of ops:  7
compiled vars:  !0 = $db
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   CAST                                          8  ~1      <array>
          1        ASSIGN                                                   !0, ~1
   10     2        INIT_FCALL                                               'test'
          3        DO_FCALL                                      0  $3      
          4        FETCH_OBJ_R                                      ~4      $3, 'prop'
          5        ECHO                                                     ~4
          6      > RETURN                                                   1

Function test:
Finding entry points
Branch analysis from position: 0
Return found
filename:       /in/elQi1
function name:  test
number of ops:  3
compiled vars:  !0 = $db
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   BIND_GLOBAL                                              !0, 'db'
    7     1      > RETURN_BY_REF                                            !0
    8     2*     > RETURN_BY_REF                                            null

End of function test

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.64 ms | 1401 KiB | 14 Q