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) { var_dump(get_called_class()); $closure = (new ReflectionMethod('Foo', 'bar'))->getClosure(); $closure(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/LS9ns
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%2FLS9ns%3A9%240'
          6        BIND_LEXICAL                                             ~5, !0
          7        ASSIGN                                                   !1, ~5
   14     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
   15    13        INIT_DYNAMIC_CALL                                        !1
         14        DO_FCALL                                      0          
         15      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FLS9ns%3A9%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LS9ns
function name:  {closure}
number of ops:  17
compiled vars:  !0 = $ref, !1 = $closure
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   BIND_STATIC                                              !0
   10     1        INIT_FCALL                                               'var_dump'
          2        GET_CALLED_CLASS                                 ~2      
          3        SEND_VAL                                                 ~2
          4        DO_ICALL                                                 
   11     5        NEW                                              $4      'ReflectionMethod'
          6        SEND_VAL_EX                                              'Foo'
          7        SEND_VAL_EX                                              'bar'
          8        DO_FCALL                                      0          
          9        INIT_METHOD_CALL                                         $4, 'getClosure'
         10        DO_FCALL                                      0  $6      
         11        ASSIGN                                                   !1, $6
   12    12        INIT_DYNAMIC_CALL                                        !1
         13        SEND_VAL_EX                                              null
         14        SEND_VAL_EX                                              <array>
         15        DO_FCALL                                      0          
   13    16      > RETURN                                                   null

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

Class Foo:
Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LS9ns
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:
147.11 ms | 1400 KiB | 15 Q