3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class A { abstract function foo(); public function callingD() { D::doSomething([$this, 'foo']); } } class B extends A { function foo() { echo 'yayff'; } } class D { public static function doSomething(callable $fun) { $fun(); } } $obj = new B; $obj->callingD();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aP3kF
function name:  (null)
number of ops:  6
compiled vars:  !0 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   NEW                                              $1      'B'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   24     3        INIT_METHOD_CALL                                         !0, 'callingD'
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

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

End of function foo

Function callingd:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aP3kF
function name:  callingD
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_STATIC_METHOD_CALL                                  'D', 'doSomething'
          1        FETCH_THIS                                       ~0      
          2        INIT_ARRAY                                       ~1      ~0
          3        ADD_ARRAY_ELEMENT                                ~1      'foo'
          4        SEND_VAL_EX                                              ~1
          5        DO_FCALL                                      0          
    8     6      > RETURN                                                   null

End of function callingd

End of class A.

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

End of function foo

Function callingd:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aP3kF
function name:  callingD
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_STATIC_METHOD_CALL                                  'D', 'doSomething'
          1        FETCH_THIS                                       ~0      
          2        INIT_ARRAY                                       ~1      ~0
          3        ADD_ARRAY_ELEMENT                                ~1      'foo'
          4        SEND_VAL_EX                                              ~1
          5        DO_FCALL                                      0          
    8     6      > RETURN                                                   null

End of function callingd

End of class B.

Class D:
Function dosomething:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aP3kF
function name:  doSomething
number of ops:  4
compiled vars:  !0 = $fun
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   RECV                                             !0      
   19     1        INIT_DYNAMIC_CALL                                        !0
          2        DO_FCALL                                      0          
   20     3      > RETURN                                                   null

End of function dosomething

End of class D.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.42 ms | 1399 KiB | 13 Q