3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public function x() { if (is_callable(array($this, "y"))) $this::y(); if (is_callable(array(self::class, "y"))) self::y(); } } class B extends A { public function y() {} } (new B())->x();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/U6KEk
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   NEW                                              $0      'B'
          1        DO_FCALL                                      0          
          2        INIT_METHOD_CALL                                         $0, 'x'
          3        DO_FCALL                                      0          
          4      > RETURN                                                   1

Class A:
Function x:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 11
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 17
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
Branch analysis from position: 11
filename:       /in/U6KEk
function name:  x
number of ops:  18
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   INIT_FCALL                                               'is_callable'
          1        FETCH_THIS                                       ~0      
          2        INIT_ARRAY                                       ~1      ~0
          3        ADD_ARRAY_ELEMENT                                ~1      'y'
          4        SEND_VAL                                                 ~1
          5        DO_ICALL                                         $2      
          6      > JMPZ                                                     $2, ->11
          7    >   FETCH_THIS                                       ~3      
          8        FETCH_CLASS                                   0  $4      ~3
          9        INIT_STATIC_METHOD_CALL                                  $4, 'y'
         10        DO_FCALL                                      0          
    6    11    >   INIT_FCALL                                               'is_callable'
         12        SEND_VAL                                                 <array>
         13        DO_ICALL                                         $6      
         14      > JMPZ                                                     $6, ->17
         15    >   INIT_STATIC_METHOD_CALL                                  'y'
         16        DO_FCALL                                      0          
    7    17    > > RETURN                                                   null

End of function x

End of class A.

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

End of function y

Function x:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 11
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 17
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
Branch analysis from position: 11
filename:       /in/U6KEk
function name:  x
number of ops:  18
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   INIT_FCALL                                               'is_callable'
          1        FETCH_THIS                                       ~0      
          2        INIT_ARRAY                                       ~1      ~0
          3        ADD_ARRAY_ELEMENT                                ~1      'y'
          4        SEND_VAL                                                 ~1
          5        DO_ICALL                                         $2      
          6      > JMPZ                                                     $2, ->11
          7    >   FETCH_THIS                                       ~3      
          8        FETCH_CLASS                                   0  $4      ~3
          9        INIT_STATIC_METHOD_CALL                                  $4, 'y'
         10        DO_FCALL                                      0          
    6    11    >   INIT_FCALL                                               'is_callable'
         12        SEND_VAL                                                 <array>
         13        DO_ICALL                                         $6      
         14      > JMPZ                                                     $6, ->17
         15    >   INIT_STATIC_METHOD_CALL                                  'y'
         16        DO_FCALL                                      0          
    7    17    > > RETURN                                                   null

End of function x

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
181.68 ms | 1400 KiB | 15 Q