3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace X; $f = function () {}; $r = new \ReflectionMethod($f, '__invoke'); var_dump($r->isClosure()); var_dump($r->getDeclaringClass()->name);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fSXsb
function name:  (null)
number of ops:  21
compiled vars:  !0 = $f, !1 = $r
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00x%5C%7Bclosure%7D%2Fin%2FfSXsb%3A5%240'
          1        ASSIGN                                                   !0, ~2
    7     2        NEW                                              $4      'ReflectionMethod'
          3        SEND_VAR_EX                                              !0
          4        SEND_VAL_EX                                              '__invoke'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !1, $4
    8     7        INIT_NS_FCALL_BY_NAME                                    'X%5Cvar_dump'
          8        INIT_METHOD_CALL                                         !1, 'isClosure'
          9        DO_FCALL                                      0  $7      
         10        SEND_VAR_NO_REF_EX                                       $7
         11        DO_FCALL                                      0          
    9    12        INIT_NS_FCALL_BY_NAME                                    'X%5Cvar_dump'
         13        CHECK_FUNC_ARG                                           
         14        INIT_METHOD_CALL                                         !1, 'getDeclaringClass'
         15        DO_FCALL                                      0  $9      
         16        SEPARATE                                         $9      $9
         17        FETCH_OBJ_FUNC_ARG                               $10     $9, 'name'
         18        SEND_FUNC_ARG                                            $10
         19        DO_FCALL                                      0          
         20      > RETURN                                                   1

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

End of function %00x%5C%7Bclosure%7D%2Fin%2FfSXsb%3A5%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.39 ms | 1395 KiB | 15 Q