3v4l.org

run code in 300+ PHP versions simultaneously
<?php class TestClass { public function doIt() { echo 'done'; } } function is_instance_callable(array $definition) { return in_array($definition[1], get_class_methods($definition[0]), true); } $callable = ['ljkkjljlkj', 'doIt']; var_dump(is_instance_callable($callable));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FG6mm
function name:  (null)
number of ops:  8
compiled vars:  !0 = $callable
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   ASSIGN                                                   !0, <array>
   18     1        INIT_FCALL                                               'var_dump'
          2        INIT_FCALL                                               'is_instance_callable'
          3        SEND_VAR                                                 !0
          4        DO_FCALL                                      0  $2      
          5        SEND_VAR                                                 $2
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

Function is_instance_callable:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FG6mm
function name:  is_instance_callable
number of ops:  13
compiled vars:  !0 = $definition
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   13     1        INIT_FCALL                                               'in_array'
          2        FETCH_DIM_R                                      ~1      !0, 1
          3        SEND_VAL                                                 ~1
          4        INIT_FCALL                                               'get_class_methods'
          5        FETCH_DIM_R                                      ~2      !0, 0
          6        SEND_VAL                                                 ~2
          7        DO_ICALL                                         $3      
          8        SEND_VAR                                                 $3
          9        SEND_VAL                                                 <true>
         10        DO_ICALL                                         $4      
         11      > RETURN                                                   $4
   14    12*     > RETURN                                                   null

End of function is_instance_callable

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

End of function doit

End of class TestClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.76 ms | 1003 KiB | 17 Q