3v4l.org

run code in 500+ PHP versions simultaneously
<?php abstract class A { private function foo() { print __CLASS__; } } abstract class B extends A { private function foo() { print __CLASS__; } } class C extends B { private function foo() { print __CLASS__; } public function goo() { parent::foo(); a::foo(); } } Closure::bind( fn() => $this->foo(), new C, A::class )();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EG63I
function name:  (null)
number of ops:  11
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   20     0  E >   INIT_STATIC_METHOD_CALL                                      'Closure', 'bind'
   21     1        DECLARE_LAMBDA_FUNCTION                              ~0      [0]
          2        SEND_VAL                                                     ~0
   22     3        NEW                                                  $1      'C'
          4        DO_FCALL                                          0          
          5        SEND_VAR                                                     $1
   23     6        SEND_VAL                                                     'A'
   20     7        DO_FCALL                                          0  $3      
   23     8        INIT_DYNAMIC_CALL                                            $3
   24     9        DO_FCALL                                          0          
         10      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EG63I
function name:  {closure:/in/EG63I:21}
number of ops:  5
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   21     0  E >   FETCH_THIS                                           $0      
          1        INIT_METHOD_CALL                                             $0, 'foo'
          2        DO_FCALL                                          0  $1      
          3      > RETURN                                                       $1
          4*     > RETURN                                                       null

End of Dynamic Function 0

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

End of function foo

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/EG63I
function name:  foo
number of ops:  2
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    8     0  E >   ECHO                                                         'B'
          1      > RETURN                                                       null

End of function foo

End of class B.

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

End of function foo

Function goo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EG63I
function name:  goo
number of ops:  5
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   15     0  E >   INIT_STATIC_METHOD_CALL                                      'foo'
          1        DO_FCALL                                          0          
   16     2        INIT_STATIC_METHOD_CALL                                      'a', 'foo'
          3        DO_FCALL                                          0          
   17     4      > RETURN                                                       null

End of function goo

End of class C.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
154.37 ms | 1389 KiB | 13 Q