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); 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; } }
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Cannot bind an instance to a static closure in /in/mrSTX on line 18 Deprecated: ReflectionFunction::__construct(): Passing null to parameter #1 ($function) of type Closure|string is deprecated in /in/mrSTX on line 18 Fatal error: Uncaught ReflectionException: Function () does not exist in /in/mrSTX:18 Stack trace: #0 /in/mrSTX(18): ReflectionFunction->__construct('') #1 {main} thrown in /in/mrSTX on line 18
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
47.01 ms | 401 KiB | 8 Q