3v4l.org

run code in 500+ PHP versions simultaneously
<?php function test(stdClass &$obj) { var_dump($obj); $obj = 'lol'; } $o = new stdClass; $o->prop = 'foo'; test($o); var_dump($o);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JZWZs
function name:  (null)
number of ops:  12
compiled vars:  !0 = $o
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   10     0  E >   NEW                                                  $1      'stdClass'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $1
   11     3        ASSIGN_OBJ                                                   !0, 'prop'
          4        OP_DATA                                                      'foo'
   13     5        INIT_FCALL                                                   'test'
          6        SEND_REF                                                     !0
          7        DO_FCALL                                          0          
   15     8        INIT_FCALL                                                   'var_dump'
          9        SEND_VAR                                                     !0
         10        DO_ICALL                                                     
         11      > RETURN                                                       1

Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JZWZs
function name:  test
number of ops:  6
compiled vars:  !0 = $obj
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   RECV                                                 !0      
    5     1        INIT_FCALL                                                   'var_dump'
          2        SEND_VAR                                                     !0
          3        DO_ICALL                                                     
    7     4        ASSIGN                                                       !0, 'lol'
    8     5      > RETURN                                                       null

End of function test

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
157.18 ms | 1387 KiB | 15 Q