3v4l.org

run code in 300+ PHP versions simultaneously
<?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 $paramt) { var_dump([$param->name, $param->getDefaultValue()]); } } }
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
string(11) "__construct" array(2) { [0]=> string(5) "array" [1]=> array(0) { } } array(2) { [0]=> string(5) "array" [1]=> array(0) { } } string(11) "__construct" array(2) { [0]=> string(5) "flags" [1]=> int(0) } array(2) { [0]=> string(5) "flags" [1]=> int(0) } string(12) "offsetExists" Fatal error: Uncaught ReflectionException: Internal error: Failed to retrieve the default value in /in/7JL83:16 Stack trace: #0 /in/7JL83(16): ReflectionParameter->getDefaultValue() #1 {main} thrown in /in/7JL83 on line 16
Process exited with code 255.
Output for 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
string(11) "__construct" Fatal error: Uncaught ReflectionException: Cannot determine default value for internal functions in /in/7JL83:16 Stack trace: #0 /in/7JL83(16): ReflectionParameter->getDefaultValue() #1 {main} thrown in /in/7JL83 on line 16
Process exited with code 255.
Output for 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.40
string(11) "__construct" Fatal error: Uncaught exception 'ReflectionException' with message 'Cannot determine default value for internal functions' in /in/7JL83:16 Stack trace: #0 /in/7JL83(16): ReflectionParameter->getDefaultValue() #1 {main} thrown in /in/7JL83 on line 16
Process exited with code 255.

preferences:
257.18 ms | 402 KiB | 376 Q