<?php function volume(int $x, int $y, int $z): int { return $x * $y * $z; } $p = fn(int $z): int => volume(3, 5, $z); // This is a useful and common way to normalize different types of callable // to a single API for reflection purposes. $c = Closure::fromCallable($p); $ref = new ReflectionFunction($c); print $ref->getNumberOfParameters() . PHP_EOL; print $ref->getParameters()[0]->getType() . PHP_EOL; print $ref->getParameters()[0]->getName() . PHP_EOL; print $ref->getReturnType() . PHP_EOL;
You have javascript disabled. You will not be able to edit any code.
Value for `_results` contains invalid data `array`