3v4l.org

run code in 300+ PHP versions simultaneously
<?php $f = static function () { }; $r = new ReflectionMethod($f, '__invoke'); // being tricky $g = $r->getClosure($f); Closure::bind($g, new stdClass());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3C86k
function name:  (null)
number of ops:  18
compiled vars:  !0 = $f, !1 = $r, !2 = $g
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_LAMBDA_FUNCTION                          ~3      [0]
          1        ASSIGN                                                   !0, ~3
    7     2        NEW                                              $5      'ReflectionMethod'
          3        SEND_VAR_EX                                              !0
          4        SEND_VAL_EX                                              '__invoke'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !1, $5
    9     7        INIT_METHOD_CALL                                         !1, 'getClosure'
          8        SEND_VAR_EX                                              !0
          9        DO_FCALL                                      0  $8      
         10        ASSIGN                                                   !2, $8
   11    11        INIT_STATIC_METHOD_CALL                                  'Closure', 'bind'
         12        SEND_VAR                                                 !2
         13        NEW                                              $10     'stdClass'
         14        DO_FCALL                                      0          
         15        SEND_VAR                                                 $10
         16        DO_FCALL                                      0          
         17      > 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/3C86k
function name:  {closure}
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E > > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
135.96 ms | 996 KiB | 13 Q