3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo(array $a) { } $class = new \ReflectionClass('ReflectionClass'); $method = $class->getMethod('getMethod'); $parameters = $method->getParameters(); $aParameter = $parameters[0]; /* $functionReflection = new ReflectionFunction('foo'); $parameters = $functionReflection->getParameters(); $aParameter = $parameters[0]; */ var_dump($class->getNamespaceName()); var_dump($class->getName()); var_dump($method->getNamespaceName()); var_dump($method->getName()); var_dump($aParameter->getNamespaceName()); var_dump($aParameter->getName()); var_dump($aParameter->getDeclaringFunction()->getNamespaceName()); var_dump($aParameter->getDeclaringFunction()->getName());
Output for git.master, git.master_jit, rfc.property-hooks
string(0) "" string(15) "ReflectionClass" string(0) "" string(9) "getMethod" Fatal error: Uncaught Error: Call to undefined method ReflectionParameter::getNamespaceName() in /in/DaV4G:18 Stack trace: #0 {main} thrown in /in/DaV4G 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:
29.58 ms | 401 KiB | 8 Q