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) { var_dump(is_callable($cl)); var_dump(is_callable($cl,true)); var_dump($cl instanceof Closure); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 11, Position 2 = 30
Branch analysis from position: 11
2 jumps found. (Code = 78) Position 1 = 12, Position 2 = 30
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 30
filename:       /in/SpQG2
function name:  (null)
number of ops:  32
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%2FSpQG2%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, ->30
         11    > > FE_FETCH_R                                               $6, !1, ->30
   16    12    >   INIT_FCALL                                               'var_dump'
         13        INIT_FCALL                                               'is_callable'
         14        SEND_VAR                                                 !1
         15        DO_ICALL                                         $7      
         16        SEND_VAR                                                 $7
         17        DO_ICALL                                                 
   17    18        INIT_FCALL                                               'var_dump'
         19        INIT_FCALL                                               'is_callable'
         20        SEND_VAR                                                 !1
         21        SEND_VAL                                                 <true>
         22        DO_ICALL                                         $9      
         23        SEND_VAR                                                 $9
         24        DO_ICALL                                                 
   19    25        INIT_FCALL                                               'var_dump'
         26        INSTANCEOF                                       ~11     !1, 'Closure'
         27        SEND_VAL                                                 ~11
         28        DO_ICALL                                                 
   13    29      > JMP                                                      ->11
         30    >   FE_FREE                                                  $6
   21    31      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FSpQG2%3A10%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SpQG2
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%2FSpQG2%3A10%240

Class a:
Function o:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SpQG2
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:
186.59 ms | 1400 KiB | 17 Q