3v4l.org

run code in 200+ PHP versions simultaneously
<?php $f = new ReflectionClass('ArrayObject'); $c = $f->getConstructor(); $params = $c->getParameters(); $param = $params[0]; var_dump($param->isOptional());
Output for 5.6.13 - 7.4.0
bool(true)
Output for 5.0.3 - 5.6.12
bool(false)
Output for 5.0.0 - 5.0.2
Fatal error: Call to undefined method ReflectionParameter::isOptional() in /in/gAh5F on line 11
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: reflectionclass in /in/gAh5F on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: reflectionclass in /in/gAh5F on line 3