3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public function meth1(){ return new B; } } class B { public function meth2(){ return 4; } } $obj = new A; echo $obj->meth1()->meth2();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vh9va
function name:  (null)
number of ops:  9
compiled vars:  !0 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   NEW                                              $1      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   16     3        INIT_METHOD_CALL                                         !0, 'meth1'
          4        DO_FCALL                                      0  $4      
          5        INIT_METHOD_CALL                                         $4, 'meth2'
          6        DO_FCALL                                      0  $5      
          7        ECHO                                                     $5
          8      > RETURN                                                   1

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

End of function meth1

End of class A.

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

End of function meth2

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.39 ms | 1394 KiB | 13 Q