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); $reflection3 = new \ReflectionFunction(function () {}); var_dump($closure, $reflection, $reflection2, $reflection3);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3YfHE
function name:  (null)
number of ops:  25
compiled vars:  !0 = $reflection, !1 = $closure, !2 = $reflection2, !3 = $reflection3
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   NEW                                              $4      'ReflectionMethod'
          1        SEND_VAL_EX                                              'Name%5CSpace%5CFoo'
          2        SEND_VAL_EX                                              'bar'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $4
   14     5        INIT_METHOD_CALL                                         !0, 'getClosure'
          6        SEND_VAL_EX                                              null
          7        DO_FCALL                                      0  $7      
          8        ASSIGN                                                   !1, $7
   15     9        NEW                                              $9      'ReflectionFunction'
         10        SEND_VAR_EX                                              !1
         11        DO_FCALL                                      0          
         12        ASSIGN                                                   !2, $9
   16    13        NEW                                              $12     'ReflectionFunction'
         14        DECLARE_LAMBDA_FUNCTION                                  '%00name%5Cspace%5C%7Bclosure%7D%2Fin%2F3YfHE%3A16%240'
         15        SEND_VAL_EX                                              ~13
         16        DO_FCALL                                      0          
         17        ASSIGN                                                   !3, $12
   18    18        INIT_NS_FCALL_BY_NAME                                    'Name%5CSpace%5Cvar_dump'
         19        SEND_VAR_EX                                              !1
         20        SEND_VAR_EX                                              !0
         21        SEND_VAR_EX                                              !2
         22        SEND_VAR_EX                                              !3
         23        DO_FCALL                                      0          
         24      > RETURN                                                   1

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

End of function %00name%5Cspace%5C%7Bclosure%7D%2Fin%2F3YfHE%3A16%240

Class Name\Space\Foo:
Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3YfHE
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:
281.61 ms | 1396 KiB | 16 Q