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; } }
Output for git.master, git.master_jit, rfc.property-hooks
ReflectionFunction::__toString(): string(75) "Closure [ <user> public method Name\Space\foo ] { @@ /in/k3JVF 13 - 16 } " ReflectionFunction::isAnonymous(): bool(false) ReflectionFunction::isDisabled(): Deprecated: Method ReflectionFunction::isDisabled() is deprecated in /in/k3JVF on line 33 bool(false) ReflectionFunction::getClosure(): object(Closure)#4 (2) { ["function"]=> string(23) "Closure::Name\Space\foo" ["this"]=> object(stdClass)#2 (0) { } } ReflectionFunction::inNamespace(): bool(true) ReflectionFunction::isClosure(): bool(true) ReflectionFunction::isDeprecated(): bool(false) ReflectionFunction::isInternal(): bool(false) ReflectionFunction::isUserDefined(): bool(true) ReflectionFunction::isGenerator(): bool(false) ReflectionFunction::isVariadic(): bool(false) ReflectionFunction::isStatic(): bool(false) ReflectionFunction::getClosureThis(): object(stdClass)#2 (0) { } ReflectionFunction::getClosureScopeClass(): object(ReflectionClass)#43 (1) { ["name"]=> string(7) "Closure" } ReflectionFunction::getClosureCalledClass(): object(ReflectionClass)#43 (1) { ["name"]=> string(8) "stdClass" } ReflectionFunction::getClosureUsedVariables(): array(0) { } ReflectionFunction::getDocComment(): bool(false) ReflectionFunction::getEndLine(): int(16) ReflectionFunction::getExtension(): NULL ReflectionFunction::getExtensionName(): bool(false) ReflectionFunction::getFileName(): string(9) "/in/k3JVF" ReflectionFunction::getName(): string(14) "Name\Space\foo" ReflectionFunction::getNamespaceName(): string(10) "Name\Space" ReflectionFunction::getNumberOfParameters(): int(0) ReflectionFunction::getNumberOfRequiredParameters(): int(0) ReflectionFunction::getParameters(): array(0) { } ReflectionFunction::getShortName(): string(3) "foo" ReflectionFunction::getStartLine(): int(13) ReflectionFunction::getStaticVariables(): array(0) { } ReflectionFunction::returnsReference(): bool(false) ReflectionFunction::hasReturnType(): bool(false) ReflectionFunction::getReturnType(): NULL ReflectionFunction::hasTentativeReturnType(): bool(false) ReflectionFunction::getTentativeReturnType(): NULL

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:
82.63 ms | 409 KiB | 8 Q