3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public function setHandler(callable $callable) { $callable(is_callable($callable)); } } class Bar extends Foo { public function setHandler($callable) { parent::setHandler($callable); } } $bar = new Bar(); $bar->setHandler('var_dump');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ruPcK
function name:  (null)
number of ops:  7
compiled vars:  !0 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   NEW                                              $1      'Bar'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   18     3        INIT_METHOD_CALL                                         !0, 'setHandler'
          4        SEND_VAL_EX                                              'var_dump'
          5        DO_FCALL                                      0          
          6      > RETURN                                                   1

Class Foo:
Function sethandler:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ruPcK
function name:  setHandler
number of ops:  8
compiled vars:  !0 = $callable
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        INIT_DYNAMIC_CALL                                        !0
          2        INIT_FCALL                                               'is_callable'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $1      
          5        SEND_VAR_NO_REF_EX                                       $1
          6        DO_FCALL                                      0          
    7     7      > RETURN                                                   null

End of function sethandler

End of class Foo.

Class Bar:
Function sethandler:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ruPcK
function name:  setHandler
number of ops:  5
compiled vars:  !0 = $callable
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
   13     1        INIT_STATIC_METHOD_CALL                                  'setHandler'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
   14     4      > RETURN                                                   null

End of function sethandler

End of class Bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.14 ms | 1395 KiB | 15 Q