3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $reflection = new ReflectionClass('ArrayObject'); $constructor = $reflection->getConstructor(); foreach($constructor->getParameters() as $p) { var_dump($p); var_dump($p->getClass()); var_dump($p->isOptional()); var_dump($p->allowsNull()); }
Output for 7.0.2 - 7.1.0
object(ReflectionParameter)#3 (1) { ["name"]=> string(5) "array" } NULL bool(true) bool(false) object(ReflectionParameter)#4 (1) { ["name"]=> string(8) "ar_flags" } NULL bool(true) bool(false) object(ReflectionParameter)#5 (1) { ["name"]=> string(14) "iterator_class" } NULL bool(true) bool(false)
Output for 5.6.13 - 7.0.1
object(ReflectionParameter)#3 (1) { ["name"]=> string(5) "array" } NULL bool(true) bool(false)
Output for 5.0.3 - 5.6.12
object(ReflectionParameter)#3 (1) { ["name"]=> string(5) "array" } NULL bool(false) bool(false)
Output for 5.0.0 - 5.0.2
object(ReflectionParameter)#3 (1) { ["name"]=> string(5) "array" } NULL Fatal error: Call to undefined method ReflectionParameter::isOptional() in /in/19X9K on line 9
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: reflectionclass in /in/19X9K on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: reflectionclass in /in/19X9K on line 2