3v4l.org

run code in 500+ PHP versions simultaneously
<?php $rc = new ReflectionClass(Closure::class); $methodNames = array_map(function ($m) { return $m->getName(); }, $rc->getMethods()); var_dump(in_array('__invoke', $methodNames)); var_dump($rc->hasMethod('__invoke'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QBIvb
function name:  (null)
number of ops:  23
compiled vars:  !0 = $rc, !1 = $methodNames
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   NEW                                                  $2      'ReflectionClass'
          1        SEND_VAL_EX                                                  'Closure'
          2        DO_FCALL                                          0          
          3        ASSIGN                                                       !0, $2
    5     4        INIT_FCALL                                                   'array_map'
          5        DECLARE_LAMBDA_FUNCTION                              ~5      [0]
    7     6        SEND_VAL                                                     ~5
          7        INIT_METHOD_CALL                                             !0, 'getMethods'
          8        DO_FCALL                                          0  $6      
          9        SEND_VAR                                                     $6
    5    10        DO_ICALL                                             $7      
         11        ASSIGN                                                       !1, $7
    9    12        INIT_FCALL                                                   'var_dump'
         13        FRAMELESS_ICALL_2                in_array            ~9      '__invoke', !1
         14        SEND_VAL                                                     ~9
         15        DO_ICALL                                                     
   10    16        INIT_FCALL                                                   'var_dump'
         17        INIT_METHOD_CALL                                             !0, 'hasMethod'
         18        SEND_VAL_EX                                                  '__invoke'
         19        DO_FCALL                                          0  $11     
         20        SEND_VAR                                                     $11
         21        DO_ICALL                                                     
         22      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QBIvb
function name:  {closure:/in/QBIvb:5}
number of ops:  5
compiled vars:  !0 = $m
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   RECV                                                 !0      
    6     1        INIT_METHOD_CALL                                             !0, 'getName'
          2        DO_FCALL                                          0  $1      
          3      > RETURN                                                       $1
    7     4*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
176.31 ms | 3236 KiB | 15 Q