3v4l.org

run code in 500+ PHP versions simultaneously
<?php class A { function bar() { return 'B'; } } class B {} $foo = new A(); $obj = new $foo->bar(); var_dump($obj);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lpN1T
function name:  (null)
number of ops:  12
compiled vars:  !0 = $foo, !1 = $obj
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   11     0  E >   NEW                                                  $2      'A'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $2
   12     3        FETCH_OBJ_R                                          ~5      !0, 'bar'
          4        FETCH_CLASS                                       0  $6      ~5
          5        NEW                                                  $7      $6
          6        DO_FCALL                                          0          
          7        ASSIGN                                                       !1, $7
   14     8        INIT_FCALL                                                   'var_dump'
          9        SEND_VAR                                                     !1
         10        DO_ICALL                                                     
         11      > RETURN                                                       1

Class A:
Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lpN1T
function name:  bar
number of ops:  2
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E > > RETURN                                                       'B'
    6     1*     > RETURN                                                       null

End of function bar

End of class A.

Class B: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
161.03 ms | 3395 KiB | 14 Q