3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public function foo(PDO $foo = null, array $bar, int $x = 0) { } } $method = new ReflectionMethod(A::class, "foo"); $params = $method->getParameters(); foreach ($params as $param) { $type = $param->getType(); var_dump($type->isBuiltin(), $type->allowsNull(), (empty($type) ? "" : $type . " ") . $param->name); print PHP_EOL . PHP_EOL; }
Output for git.master, git.master_jit, rfc.property-hooks
bool(false) bool(true) string(8) "?PDO foo" bool(true) bool(false) string(9) "array bar" bool(true) bool(false) string(5) "int x"

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
26.99 ms | 405 KiB | 5 Q