3v4l.org

run code in 500+ PHP versions simultaneously
<?php class A { function a() {} } class B extends A {} class C extends B { function a() { var_dump( is_callable( 'parent::a' ) ); var_dump( is_callable( 'A::a' ) ); var_dump( is_callable( array( 'A', 'a' ) ) ); var_dump( method_exists( 'parent', 'a' ) ); var_dump( method_exists( 'A', 'a' ) ); } } $c = new C; $c->a();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/it5tc
function name:  (null)
number of ops:  6
compiled vars:  !0 = $c
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   19     0  E >   NEW                                                  $1      'C'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $1
   20     3        INIT_METHOD_CALL                                             !0, 'a'
          4        DO_FCALL                                          0          
          5      > RETURN                                                       1

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

End of function a

End of class A.

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

End of function a

End of class B.

Class C:
Function a:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/it5tc
function name:  a
number of ops:  33
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   11     0  E >   INIT_FCALL                                                   'var_dump'
          1        INIT_FCALL                                                   'is_callable'
          2        SEND_VAL                                                     'parent%3A%3Aa'
          3        DO_ICALL                                             $0      
          4        SEND_VAR                                                     $0
          5        DO_ICALL                                                     
   12     6        INIT_FCALL                                                   'var_dump'
          7        INIT_FCALL                                                   'is_callable'
          8        SEND_VAL                                                     'A%3A%3Aa'
          9        DO_ICALL                                             $2      
         10        SEND_VAR                                                     $2
         11        DO_ICALL                                                     
   13    12        INIT_FCALL                                                   'var_dump'
         13        INIT_FCALL                                                   'is_callable'
         14        SEND_VAL                                                     <array>
         15        DO_ICALL                                             $4      
         16        SEND_VAR                                                     $4
         17        DO_ICALL                                                     
   14    18        INIT_FCALL                                                   'var_dump'
         19        INIT_FCALL                                                   'method_exists'
         20        SEND_VAL                                                     'parent'
         21        SEND_VAL                                                     'a'
         22        DO_ICALL                                             $6      
         23        SEND_VAR                                                     $6
         24        DO_ICALL                                                     
   15    25        INIT_FCALL                                                   'var_dump'
         26        INIT_FCALL                                                   'method_exists'
         27        SEND_VAL                                                     'A'
         28        SEND_VAL                                                     'a'
         29        DO_ICALL                                             $8      
         30        SEND_VAR                                                     $8
         31        DO_ICALL                                                     
   16    32      > RETURN                                                       null

End of function a

End of class C.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
168.7 ms | 2961 KiB | 16 Q