3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $rc = new ReflectionClass('ArrayIterator'); foreach ($rc->getMethods() as $method) { if ($method->isAbstract() || $method->isStatic()) continue; foreach ($method->getParameters() as $param) { var_dump($method->name); foreach ($method->getParameters() as $param) { if ($param->isOptional()) var_dump([$param->name, $param->getDefaultValue()]); } } }
based on 7JL83
Output for 7.0.0 - 7.2.0
string(11) "__construct" Fatal error: Uncaught ReflectionException: Cannot determine default value for internal functions in /in/aVSjn:17 Stack trace: #0 /in/aVSjn(17): ReflectionParameter->getDefaultValue() #1 {main} thrown in /in/aVSjn on line 17
Process exited with code 255.
Output for 5.6.13 - 5.6.28
string(11) "__construct" Fatal error: Uncaught exception 'ReflectionException' with message 'Cannot determine default value for internal functions' in /in/aVSjn:17 Stack trace: #0 /in/aVSjn(17): ReflectionParameter->getDefaultValue() #1 {main} thrown in /in/aVSjn on line 17
Process exited with code 255.
Output for 5.4.2 - 5.6.12
string(11) "__construct" string(12) "offsetExists" string(9) "offsetGet" string(9) "offsetSet" string(9) "offsetSet" string(11) "offsetUnset" string(6) "append" string(8) "setFlags" string(6) "uasort" string(6) "uksort" string(11) "unserialize" string(4) "seek"
Output for 5.3.17 - 5.3.29
Parse error: syntax error, unexpected '[', expecting ')' in /in/aVSjn on line 17
Process exited with code 255.