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 \ReflectionMethod(__NAMESPACE__ . '\\Foo', 'bar'))->getClosure()->bindTo(new \stdClass(), __NAMESPACE__ .'\\foo')); //$reflection = new \ReflectionMethod('Name\\Space\\Foo', 'bar'); //$closure = $reflection->getClosure(null); //$reflection2 = new \ReflectionFunction($closure); var_dump((string)$reflection2); /* 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
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/c70TT
function name:  (null)
number of ops:  21
compiled vars:  !0 = $reflection2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   NEW                                              $1      'ReflectionFunction'
          1        NEW                                              $2      'ReflectionMethod'
          2        SEND_VAL_EX                                              'Name%5CSpace%5CFoo'
          3        SEND_VAL_EX                                              'bar'
          4        DO_FCALL                                      0          
          5        INIT_METHOD_CALL                                         $2, 'getClosure'
          6        DO_FCALL                                      0  $4      
          7        INIT_METHOD_CALL                                         $4, 'bindTo'
          8        NEW                                              $5      'stdClass'
          9        DO_FCALL                                      0          
         10        SEND_VAR_NO_REF_EX                                       $5
   19    11        SEND_VAL_EX                                              'Name%5CSpace%5Cfoo'
         12        DO_FCALL                                      0  $7      
         13        SEND_VAR_NO_REF_EX                                       $7
         14        DO_FCALL                                      0          
   18    15        ASSIGN                                                   !0, $1
   26    16        INIT_NS_FCALL_BY_NAME                                    'Name%5CSpace%5Cvar_dump'
         17        CAST                                          6  ~10     !0
         18        SEND_VAL_EX                                              ~10
         19        DO_FCALL                                      0          
   37    20      > RETURN                                                   1

Function name%5Cspace%5Cfoo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/c70TT
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/c70TT
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:
152 ms | 1388 KiB | 15 Q