3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $ref = new ReflectionFunction('strpos'); $params = $ref->getParameters(); $param = end($params); var_dump($param->name, $param->isOptional(), $param->isDefaultValueAvailable()); if ($param->isDefaultValueAvailable()) { var_dump($param->getDefaultValue()); }
based on IEIjD
Output for 5.2.0 - 5.6.28, 7.0.0 - 7.1.0
string(6) "offset" bool(true) bool(false)
Output for hhvm-3.12.0
string(6) "offset" bool(true) bool(true) int(0)
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.0.0 - 5.1.6
Notice: Trying to get property of non-object in /in/Ofac4 on line 7 Fatal error: Call to a member function isOptional() on a non-object in /in/Ofac4 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/Ofac4 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/Ofac4 on line 3