3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Base { } class NoMagic extends Base { function isParentFoobarCallable() { return is_callable('parent::foobar'); } } class Magic extends NoMagic { function __call($method, $args) {} } $nomagic = new NoMagic(); var_dump($nomagic->isParentFoobarCallable()); $magic = new Magic(); var_dump($magic->isParentFoobarCallable());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/q3pbc
function name:  (null)
number of ops:  17
compiled vars:  !0 = $nomagic, !1 = $magic
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   NEW                                              $2      'NoMagic'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   17     3        INIT_FCALL                                               'var_dump'
          4        INIT_METHOD_CALL                                         !0, 'isParentFoobarCallable'
          5        DO_FCALL                                      0  $5      
          6        SEND_VAR                                                 $5
          7        DO_ICALL                                                 
   19     8        NEW                                              $7      'Magic'
          9        DO_FCALL                                      0          
         10        ASSIGN                                                   !1, $7
   20    11        INIT_FCALL                                               'var_dump'
         12        INIT_METHOD_CALL                                         !1, 'isParentFoobarCallable'
         13        DO_FCALL                                      0  $10     
         14        SEND_VAR                                                 $10
         15        DO_ICALL                                                 
         16      > RETURN                                                   1

Class Base: [no user functions]
Class NoMagic:
Function isparentfoobarcallable:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/q3pbc
function name:  isParentFoobarCallable
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   INIT_FCALL                                               'is_callable'
          1        SEND_VAL                                                 'parent%3A%3Afoobar'
          2        DO_ICALL                                         $0      
          3      > RETURN                                                   $0
    9     4*     > RETURN                                                   null

End of function isparentfoobarcallable

End of class NoMagic.

Class Magic:
Function __call:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/q3pbc
function name:  __call
number of ops:  3
compiled vars:  !0 = $method, !1 = $args
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2      > RETURN                                                   null

End of function __call

Function isparentfoobarcallable:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/q3pbc
function name:  isParentFoobarCallable
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   INIT_FCALL                                               'is_callable'
          1        SEND_VAL                                                 'parent%3A%3Afoobar'
          2        DO_ICALL                                         $0      
          3      > RETURN                                                   $0
    9     4*     > RETURN                                                   null

End of function isparentfoobarcallable

End of class Magic.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.01 ms | 1405 KiB | 17 Q