3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function foo(array $a) { } $class = new \ReflectionClass('ReflectionClass'); $method = $class->getMethod('getMethod'); $parameters = $functionReflection->getParameters(); $aParameter = $parameters[0]; /* $functionReflection = new ReflectionFunction('foo'); $parameters = $functionReflection->getParameters(); $aParameter = $parameters[0]; */ var_dump($aParameter->getName()); var_dump($aParameter->getDeclaringFunction()->getName());

Shows result from various feature-branches currently under review from the php developers. Contact me to have additional branches featured.

Output for Typed properties v2
Notice: Undefined variable: functionReflection in /in/UE8Ht on line 6 Fatal error: Uncaught Error: Call to a member function getParameters() on null in /in/UE8Ht:6 Stack trace: #0 {main} thrown in /in/UE8Ht on line 6
Output for Array change keys
Notice: Undefined variable: functionReflection in /in/UE8Ht on line 6 Fatal error: Uncaught Error: Call to a member function getParameters() on null in /in/UE8Ht:6 Stack trace: #0 {main} thrown in /in/UE8Ht on line 6
Output for Lexical anon
Notice: Undefined variable: functionReflection in /in/UE8Ht on line 6 Catchable fatal error: Call to a member function getParameters() on null in /in/UE8Ht on line 6

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