3v4l.org

run code in 300+ PHP versions simultaneously
<?php $foo = new class {}; function modify($a) { global $foo; var_dump($a === $foo); $a->hello = "world"; var_dump($a === $foo); } modify($foo); var_dump($foo);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/p9Deo
function name:  (null)
number of ops:  11
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_ANON_CLASS                               <unknown> 
          1        NEW                                              $2      $1
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
   13     4        INIT_FCALL                                               'modify'
          5        SEND_VAR                                                 !0
          6        DO_FCALL                                      0          
   14     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Function modify:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/p9Deo
function name:  modify
number of ops:  13
compiled vars:  !0 = $a, !1 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        BIND_GLOBAL                                              !1, 'foo'
    7     2        INIT_FCALL                                               'var_dump'
          3        IS_IDENTICAL                                     ~2      !0, !1
          4        SEND_VAL                                                 ~2
          5        DO_ICALL                                                 
    9     6        ASSIGN_OBJ                                               !0, 'hello'
          7        OP_DATA                                                  'world'
   10     8        INIT_FCALL                                               'var_dump'
          9        IS_IDENTICAL                                     ~5      !0, !1
         10        SEND_VAL                                                 ~5
         11        DO_ICALL                                                 
   11    12      > RETURN                                                   null

End of function modify

Class class@anonymous: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
201.08 ms | 1002 KiB | 15 Q