3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function f(int $a, Foo $b, $c) { } $r = new ReflectionMethod('Memcached', 'add'); foreach ($r->getParameters() as $p) { echo $p, "\n"; if ($p->hasType()) { echo $p->getType(); var_dump($p->getType()); } }
based on GQv1o
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught ReflectionException: Class Memcached does not exist in /in/oYn1R:7 Stack trace: #0 /in/oYn1R(7): ReflectionMethod->__construct('Memcached', 'add') #1 {main} thrown in /in/oYn1R on line 7
Process exited with code 255.
Output for 5.3.21 - 5.6.28
Fatal error: Uncaught exception 'ReflectionException' with message 'Class Memcached does not exist' in /in/oYn1R:7 Stack trace: #0 /in/oYn1R(7): ReflectionMethod->__construct('Memcached', 'add') #1 {main} thrown in /in/oYn1R on line 7
Process exited with code 255.