3v4l.org

run code in 300+ PHP versions simultaneously
<?php class a { static public function o() { return true;} } $cls = [ a::o(), 'a::o','strpos::test' , 'strlen', function(){}, null]; 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 = 11, Position 2 = 39
Branch analysis from position: 11
2 jumps found. (Code = 78) Position 1 = 12, Position 2 = 39
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 39
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 39
filename:       /in/1OB94
function name:  (null)
number of ops:  41
compiled vars:  !0 = $cls, !1 = $cl
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   INIT_STATIC_METHOD_CALL                                  'a', 'o'
          1        DO_FCALL                                      0  $2      
          2        INIT_ARRAY                                       ~3      $2
          3        ADD_ARRAY_ELEMENT                                ~3      'a%3A%3Ao'
          4        ADD_ARRAY_ELEMENT                                ~3      'strpos%3A%3Atest'
          5        ADD_ARRAY_ELEMENT                                ~3      'strlen'
          6        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F1OB94%3A10%240'
          7        ADD_ARRAY_ELEMENT                                ~3      ~4
          8        ADD_ARRAY_ELEMENT                                ~3      null
          9        ASSIGN                                                   !0, ~3
   13    10      > FE_RESET_R                                       $6      !0, ->39
         11    > > FE_FETCH_R                                               $6, !1, ->39
   15    12    >   INIT_FCALL                                               'var_export'
         13        SEND_VAR                                                 !1
         14        SEND_VAL                                                 <true>
         15        DO_ICALL                                         $7      
         16        ECHO                                                     $7
         17        ECHO                                                     '%09'
   17    18        ECHO                                                     'is_callable%0A'
   18    19        INIT_FCALL                                               'var_dump'
         20        INIT_FCALL                                               'is_callable'
         21        SEND_VAR                                                 !1
         22        DO_ICALL                                         $8      
         23        SEND_VAR                                                 $8
         24        DO_ICALL                                                 
   19    25        ECHO                                                     'is_callable+by+syntax%0A'
   20    26        INIT_FCALL                                               'var_dump'
         27        INIT_FCALL                                               'is_callable'
         28        SEND_VAR                                                 !1
         29        SEND_VAL                                                 <true>
         30        DO_ICALL                                         $10     
         31        SEND_VAR                                                 $10
         32        DO_ICALL                                                 
   21    33        ECHO                                                     'instance+of+closure%0A'
   22    34        INIT_FCALL                                               'var_dump'
         35        INSTANCEOF                                       ~12     !1, 'Closure'
         36        SEND_VAL                                                 ~12
         37        DO_ICALL                                                 
   13    38      > JMP                                                      ->11
         39    >   FE_FREE                                                  $6
   24    40      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2F1OB94%3A10%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1OB94
function name:  {closure}
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E > > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F1OB94%3A10%240

Class a:
Function o:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1OB94
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 8.0.0


preferences:
167.37 ms | 1400 KiB | 19 Q