3v4l.org

run code in 300+ PHP versions simultaneously
<?php $ref = new ReflectionClass('ReflectionMethod'); foreach ($ref->getMethod('invoke')->getParameters() as $parameter) { var_dump($parameter->getName()); var_dump($parameter->isOptional()); var_dump($parameter->isVariadic()); var_dump('---'); }
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(6) "object" bool(false) bool(false) string(3) "---" string(4) "args" bool(true) bool(true) string(3) "---"
Output for 5.6.0 - 5.6.28, 7.0.0 - 7.0.20, 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(6) "object" bool(false) bool(false) string(3) "---" string(4) "args" bool(false) bool(false) string(3) "---"
Output for 5.5.0 - 5.5.38
string(6) "object" bool(false) Fatal error: Call to undefined method ReflectionParameter::isVariadic() in /in/PXYvm on line 7
Process exited with code 255.

preferences:
203.17 ms | 401 KiB | 269 Q