3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ParentClass { public function foo() { } } class ChildClass extends ParentClass { public function foo() { } } $parentCallable = [new ChildClass(), 'parent::foo']; $childCallable = [new ChildClass(), 'self::foo']; \is_callable($parentCallable, false, $parentName); \is_callable($childCallable, false, $childName); echo $parentName; echo "\n"; echo $childName;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aUfCc
function name:  (null)
number of ops:  24
compiled vars:  !0 = $parentCallable, !1 = $childCallable, !2 = $parentName, !3 = $childName
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   NEW                                              $4      'ChildClass'
          1        DO_FCALL                                      0          
          2        INIT_ARRAY                                       ~6      $4
          3        ADD_ARRAY_ELEMENT                                ~6      'parent%3A%3Afoo'
          4        ASSIGN                                                   !0, ~6
   16     5        NEW                                              $8      'ChildClass'
          6        DO_FCALL                                      0          
          7        INIT_ARRAY                                       ~10     $8
          8        ADD_ARRAY_ELEMENT                                ~10     'self%3A%3Afoo'
          9        ASSIGN                                                   !1, ~10
   18    10        INIT_FCALL                                               'is_callable'
         11        SEND_VAR                                                 !0
         12        SEND_VAL                                                 <false>
         13        SEND_REF                                                 !2
         14        DO_ICALL                                                 
   19    15        INIT_FCALL                                               'is_callable'
         16        SEND_VAR                                                 !1
         17        SEND_VAL                                                 <false>
         18        SEND_REF                                                 !3
         19        DO_ICALL                                                 
   21    20        ECHO                                                     !2
   22    21        ECHO                                                     '%0A'
   23    22        ECHO                                                     !3
   24    23      > RETURN                                                   1

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

End of function foo

End of class ParentClass.

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

End of function foo

End of class ChildClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.99 ms | 1388 KiB | 15 Q