3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { function run() { } static function srun() { } } var_dump(is_callable(["foo", "run"])); var_dump(is_callable(["foo", "srun"])); var_dump(is_callable(["foo", "run"], true)); var_dump(is_callable([new Foo, "run"]));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FfASj
function name:  (null)
number of ops:  30
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'is_callable'
          2        SEND_VAL                                                 <array>
          3        DO_ICALL                                         $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
   11     6        INIT_FCALL                                               'var_dump'
          7        INIT_FCALL                                               'is_callable'
          8        SEND_VAL                                                 <array>
          9        DO_ICALL                                         $2      
         10        SEND_VAR                                                 $2
         11        DO_ICALL                                                 
   12    12        INIT_FCALL                                               'var_dump'
         13        INIT_FCALL                                               'is_callable'
         14        SEND_VAL                                                 <array>
         15        SEND_VAL                                                 <true>
         16        DO_ICALL                                         $4      
         17        SEND_VAR                                                 $4
         18        DO_ICALL                                                 
   13    19        INIT_FCALL                                               'var_dump'
         20        INIT_FCALL                                               'is_callable'
         21        NEW                                              $6      'Foo'
         22        DO_FCALL                                      0          
         23        INIT_ARRAY                                       ~8      $6
         24        ADD_ARRAY_ELEMENT                                ~8      'run'
         25        SEND_VAL                                                 ~8
         26        DO_ICALL                                         $9      
         27        SEND_VAR                                                 $9
         28        DO_ICALL                                                 
         29      > RETURN                                                   1

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

End of function run

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

End of function srun

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.26 ms | 1396 KiB | 17 Q