3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class a { static public function o() { return true;} } $cls = [ '' ]; foreach($cls as $cl) { echo var_export($cl, true); echo "\t"; echo "is_callable\n"; var_dump(is_callable($cl)); echo "is_callable by syntax\n"; var_dump(is_callable($cl,true)); echo "instance of closure\n"; var_dump($cl instanceof Closure); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 31
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 31
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 31
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 31
filename:       /in/1R3XQ
function name:  (null)
number of ops:  33
compiled vars:  !0 = $cls, !1 = $cl
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   NOP                                                      
  10     1        ASSIGN                                                   !0, <array>
  13     2      > FE_RESET_R                                       $4      !0, ->31
         3    > > FE_FETCH_R                                               $4, !1, ->31
  15     4    >   INIT_FCALL                                               'var_export'
         5        SEND_VAR                                                 !1
         6        SEND_VAL                                                 <true>
         7        DO_ICALL                                         $5      
         8        ECHO                                                     $5
         9        ECHO                                                     '%09'
  17    10        ECHO                                                     'is_callable%0A'
  18    11        INIT_FCALL                                               'var_dump'
        12        INIT_FCALL                                               'is_callable'
        13        SEND_VAR                                                 !1
        14        DO_ICALL                                         $6      
        15        SEND_VAR                                                 $6
        16        DO_ICALL                                                 
  19    17        ECHO                                                     'is_callable+by+syntax%0A'
  20    18        INIT_FCALL                                               'var_dump'
        19        INIT_FCALL                                               'is_callable'
        20        SEND_VAR                                                 !1
        21        SEND_VAL                                                 <true>
        22        DO_ICALL                                         $8      
        23        SEND_VAR                                                 $8
        24        DO_ICALL                                                 
  21    25        ECHO                                                     'instance+of+closure%0A'
  22    26        INIT_FCALL                                               'var_dump'
        27        INSTANCEOF                                       ~10     !1, 'Closure'
        28        SEND_VAL                                                 ~10
        29        DO_ICALL                                                 
        30      > JMP                                                      ->3
        31    >   FE_FREE                                                  $4
  24    32      > RETURN                                                   1

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

End of function o

End of class a.

Generated using Vulcan Logic Dumper, using php 7.3.0