3v4l.org

run code in 300+ PHP versions simultaneously
<?php $foo = (object)['hello' => 42]; function bar() { $foo = (object)['hello' => 41]; echo $foo->hello; global $foo; echo $foo->hello; } bar();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1hKOg
function name:  (null)
number of ops:  5
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   CAST                                          8  ~1      <array>
          1        ASSIGN                                                   !0, ~1
   14     2        INIT_FCALL                                               'bar'
          3        DO_FCALL                                      0          
          4      > RETURN                                                   1

Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1hKOg
function name:  bar
number of ops:  8
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   CAST                                          8  ~1      <array>
          1        ASSIGN                                                   !0, ~1
    7     2        FETCH_OBJ_R                                      ~3      !0, 'hello'
          3        ECHO                                                     ~3
    9     4        BIND_GLOBAL                                              !0, 'foo'
   11     5        FETCH_OBJ_R                                      ~4      !0, 'hello'
          6        ECHO                                                     ~4
   12     7      > RETURN                                                   null

End of function bar

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.12 ms | 1397 KiB | 14 Q