3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Name\Space; class Foo { public static function bar() { } } $reflection = new \ReflectionMethod('Name\\Space\\Foo', 'bar'); $closure = $reflection->getClosure(null); $reflection2 = new \ReflectionFunction($closure); var_dump($closure, $reflection, \Reflection::export($reflection2));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6GAjP
function name:  (null)
number of ops:  22
compiled vars:  !0 = $reflection, !1 = $closure, !2 = $reflection2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   NEW                                              $3      'ReflectionMethod'
          1        SEND_VAL_EX                                              'Name%5CSpace%5CFoo'
          2        SEND_VAL_EX                                              'bar'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $3
   14     5        INIT_METHOD_CALL                                         !0, 'getClosure'
          6        SEND_VAL_EX                                              null
          7        DO_FCALL                                      0  $6      
          8        ASSIGN                                                   !1, $6
   15     9        NEW                                              $8      'ReflectionFunction'
         10        SEND_VAR_EX                                              !1
         11        DO_FCALL                                      0          
         12        ASSIGN                                                   !2, $8
   17    13        INIT_NS_FCALL_BY_NAME                                    'Name%5CSpace%5Cvar_dump'
         14        SEND_VAR_EX                                              !1
         15        SEND_VAR_EX                                              !0
         16        INIT_STATIC_METHOD_CALL                                  'Reflection', 'export'
         17        SEND_VAR_EX                                              !2
         18        DO_FCALL                                      0  $11     
         19        SEND_VAR_NO_REF_EX                                       $11
         20        DO_FCALL                                      0          
         21      > RETURN                                                   1

Class Name\Space\Foo:
Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6GAjP
function name:  bar
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E > > RETURN                                                   null

End of function bar

End of class Name\Space\Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.04 ms | 1387 KiB | 15 Q