3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private static function bar($t) { var_dump ($t);} } $ref= (new ReflectionMethod('ReflectionMethod', 'invokeArgs')); $closure = function () use ($ref) { $ref->invokeArgs(new ReflectionMethod('Foo', 'bar'), [null,[2]]); }; $closure = $closure->bindTo(null, 'Foo'); $closure();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AaH34
function name:  (null)
number of ops:  16
compiled vars:  !0 = $ref, !1 = $closure
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   NEW                                              $2      'ReflectionMethod'
          1        SEND_VAL_EX                                              'ReflectionMethod'
          2        SEND_VAL_EX                                              'invokeArgs'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $2
    9     5        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FAaH34%3A9%240'
          6        BIND_LEXICAL                                             ~5, !0
          7        ASSIGN                                                   !1, ~5
   12     8        INIT_METHOD_CALL                                         !1, 'bindTo'
          9        SEND_VAL_EX                                              null
         10        SEND_VAL_EX                                              'Foo'
         11        DO_FCALL                                      0  $7      
         12        ASSIGN                                                   !1, $7
   13    13        INIT_DYNAMIC_CALL                                        !1
         14        DO_FCALL                                      0          
         15      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FAaH34%3A9%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AaH34
function name:  {closure}
number of ops:  10
compiled vars:  !0 = $ref
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   BIND_STATIC                                              !0
   10     1        INIT_METHOD_CALL                                         !0, 'invokeArgs'
          2        NEW                                              $1      'ReflectionMethod'
          3        SEND_VAL_EX                                              'Foo'
          4        SEND_VAL_EX                                              'bar'
          5        DO_FCALL                                      0          
          6        SEND_VAR_NO_REF_EX                                       $1
          7        SEND_VAL_EX                                              <array>
          8        DO_FCALL                                      0          
   11     9      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FAaH34%3A9%240

Class Foo:
Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AaH34
function name:  bar
number of ops:  5
compiled vars:  !0 = $t
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        INIT_FCALL                                               'var_dump'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
          4      > RETURN                                                   null

End of function bar

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.87 ms | 1396 KiB | 15 Q