3v4l.org

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

Function name%5Cspace%5Cfoo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pBAeW
function name:  Name\Space\foo
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   FETCH_THIS                                       ~0      
          1      > RETURN                                                   ~0
   16     2*     > RETURN                                                   null

End of function name%5Cspace%5Cfoo

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