3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { public $t = 1; } $o = new Test(); function modifyObj(&$obj) { $obj = new Test(); $obj->t = 2; } modifyObj($o); var_dump($o->t);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TgFnD
function name:  (null)
number of ops:  11
compiled vars:  !0 = $o
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   NEW                                              $1      'Test'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   15     3        INIT_FCALL                                               'modifyobj'
          4        SEND_REF                                                 !0
          5        DO_FCALL                                      0          
   17     6        INIT_FCALL                                               'var_dump'
          7        FETCH_OBJ_R                                      ~5      !0, 't'
          8        SEND_VAL                                                 ~5
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Function modifyobj:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TgFnD
function name:  modifyObj
number of ops:  7
compiled vars:  !0 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
   11     1        NEW                                              $1      'Test'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   12     4        ASSIGN_OBJ                                               !0, 't'
          5        OP_DATA                                                  2
   13     6      > RETURN                                                   null

End of function modifyobj

Class Test: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.25 ms | 1397 KiB | 16 Q