3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $ref = new ReflectionFunction('gmmktime'); $params = $ref->getParameters(); $param = reset($params); var_dump($param->isOptional(), $param->isDefaultValueAvailable()); if ($param->isDefaultValueAvailable()) { var_dump($param->getDefaultValue()); }
Output for 5.2.0 - 7.1.0
bool(true) bool(false)
Output for 5.0.0 - 5.1.6
Fatal error: Call to a member function isOptional() on a non-object in /in/t8M6E on line 7
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: reflectionfunction in /in/t8M6E on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: reflectionfunction in /in/t8M6E on line 3