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); echo PHP_EOL; echo PHP_EOL; $ReflectionClass = get_class($reflection); $ReflectionCeption = new \ReflectionClass($ReflectionClass); foreach ($ReflectionCeption->getMethods(\ReflectionMethod::IS_PUBLIC) as $Method) { if(!$Method->isStatic() && $Method->getNumberOfParameters() === 0) { echo sprintf('%s::%s(): ', $ReflectionClass, $Method->name); var_dump($Method->invoke($reflection)); echo PHP_EOL; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 29, Position 2 = 56
Branch analysis from position: 29
2 jumps found. (Code = 78) Position 1 = 30, Position 2 = 56
Branch analysis from position: 30
2 jumps found. (Code = 46) Position 1 = 34, Position 2 = 38
Branch analysis from position: 34
2 jumps found. (Code = 43) Position 1 = 39, Position 2 = 55
Branch analysis from position: 39
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
Branch analysis from position: 55
Branch analysis from position: 38
Branch analysis from position: 56
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 56
filename:       /in/V6HCV
function name:  (null)
number of ops:  58
compiled vars:  !0 = $reflection, !1 = $closure, !2 = $reflection2, !3 = $ReflectionClass, !4 = $ReflectionCeption, !5 = $Method
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   NEW                                              $6      'ReflectionMethod'
          1        SEND_VAL_EX                                              'Name%5CSpace%5CFoo'
          2        SEND_VAL_EX                                              'bar'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $6
   14     5        INIT_METHOD_CALL                                         !0, 'getClosure'
          6        SEND_VAL_EX                                              null
          7        DO_FCALL                                      0  $9      
          8        ASSIGN                                                   !1, $9
   15     9        NEW                                              $11     'ReflectionFunction'
         10        SEND_VAR_EX                                              !1
         11        DO_FCALL                                      0          
         12        ASSIGN                                                   !2, $11
   17    13        FETCH_CONSTANT                                   ~14     'Name%5CSpace%5CPHP_EOL'
         14        ECHO                                                     ~14
   18    15        FETCH_CONSTANT                                   ~15     'Name%5CSpace%5CPHP_EOL'
         16        ECHO                                                     ~15
   19    17        INIT_NS_FCALL_BY_NAME                                    'Name%5CSpace%5Cget_class'
         18        SEND_VAR_EX                                              !0
         19        DO_FCALL                                      0  $16     
         20        ASSIGN                                                   !3, $16
   20    21        NEW                                              $18     'ReflectionClass'
         22        SEND_VAR_EX                                              !3
         23        DO_FCALL                                      0          
         24        ASSIGN                                                   !4, $18
   21    25        INIT_METHOD_CALL                                         !4, 'getMethods'
         26        SEND_VAL_EX                                              1
         27        DO_FCALL                                      0  $21     
         28      > FE_RESET_R                                       $22     $21, ->56
         29    > > FE_FETCH_R                                               $22, !5, ->56
   22    30    >   INIT_METHOD_CALL                                         !5, 'isStatic'
         31        DO_FCALL                                      0  $23     
         32        BOOL_NOT                                         ~24     $23
         33      > JMPZ_EX                                          ~24     ~24, ->38
         34    >   INIT_METHOD_CALL                                         !5, 'getNumberOfParameters'
         35        DO_FCALL                                      0  $25     
         36        IS_IDENTICAL                                     ~26     $25, 0
         37        BOOL                                             ~24     ~26
         38    > > JMPZ                                                     ~24, ->55
   23    39    >   INIT_NS_FCALL_BY_NAME                                    'Name%5CSpace%5Csprintf'
         40        SEND_VAL_EX                                              '%25s%3A%3A%25s%28%29%3A+'
         41        SEND_VAR_EX                                              !3
         42        CHECK_FUNC_ARG                                           
         43        FETCH_OBJ_FUNC_ARG                               $27     !5, 'name'
         44        SEND_FUNC_ARG                                            $27
         45        DO_FCALL                                      0  $28     
         46        ECHO                                                     $28
   24    47        INIT_NS_FCALL_BY_NAME                                    'Name%5CSpace%5Cvar_dump'
         48        INIT_METHOD_CALL                                         !5, 'invoke'
         49        SEND_VAR_EX                                              !0
         50        DO_FCALL                                      0  $29     
         51        SEND_VAR_NO_REF_EX                                       $29
         52        DO_FCALL                                      0          
   25    53        FETCH_CONSTANT                                   ~31     'Name%5CSpace%5CPHP_EOL'
         54        ECHO                                                     ~31
   21    55    > > JMP                                                      ->29
         56    >   FE_FREE                                                  $22
   27    57      > 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/V6HCV
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:
151.75 ms | 1400 KiB | 19 Q