3v4l.org

run code in 300+ PHP versions simultaneously
<?php class bar { public function doStuff(stdClass $obj) { $obj->foo = 'test'; $obj = null; } } class foo { public function __construct() { $bar = new bar(); $obj = new stdClass(); $bar->doStuff($obj); var_dump($obj); } } $foo = new foo();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Rh3QI
function name:  (null)
number of ops:  4
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   NEW                                              $1      'foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
          3      > RETURN                                                   1

Class bar:
Function dostuff:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Rh3QI
function name:  doStuff
number of ops:  5
compiled vars:  !0 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     1        ASSIGN_OBJ                                               !0, 'foo'
          2        OP_DATA                                                  'test'
    6     3        ASSIGN                                                   !0, null
    7     4      > RETURN                                                   null

End of function dostuff

End of class bar.

Class foo:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Rh3QI
function name:  __construct
number of ops:  13
compiled vars:  !0 = $bar, !1 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   NEW                                              $2      'bar'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   14     3        NEW                                              $5      'stdClass'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $5
   15     6        INIT_METHOD_CALL                                         !0, 'doStuff'
          7        SEND_VAR_EX                                              !1
          8        DO_FCALL                                      0          
   16     9        INIT_FCALL                                               'var_dump'
         10        SEND_VAR                                                 !1
         11        DO_ICALL                                                 
   17    12      > RETURN                                                   null

End of function __construct

End of class foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.88 ms | 1396 KiB | 15 Q