3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace X; class A { public function foo(\Y\B $b) { return $b->bar(); } } namespace Y; class B extends \X\A { protected function bar() { return 'OK'; } } echo (new \X\A)->foo(new B);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9ZGQV
function name:  (null)
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   NEW                                              $0      'X%5CA'
          1        DO_FCALL                                      0          
          2        INIT_METHOD_CALL                                         $0, 'foo'
          3        NEW                                              $2      'Y%5CB'
          4        DO_FCALL                                      0          
          5        SEND_VAR_NO_REF_EX                                       $2
          6        DO_FCALL                                      0  $4      
          7        ECHO                                                     $4
          8      > RETURN                                                   1

Class X\A:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9ZGQV
function name:  foo
number of ops:  5
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    7     1        INIT_METHOD_CALL                                         !0, 'bar'
          2        DO_FCALL                                      0  $1      
          3      > RETURN                                                   $1
    8     4*     > RETURN                                                   null

End of function foo

End of class X\A.

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

End of function bar

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9ZGQV
function name:  foo
number of ops:  5
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    7     1        INIT_METHOD_CALL                                         !0, 'bar'
          2        DO_FCALL                                      0  $1      
          3      > RETURN                                                   $1
    8     4*     > RETURN                                                   null

End of function foo

End of class Y\B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.77 ms | 1008 KiB | 13 Q