1
0
mirror of https://github.com/php/php-src.git synced 2026-04-27 01:48:26 +02:00
Files
archived-php-src/ext/reflection/tests/closures_002.phpt
T
Fabien Villepinte a555cc0b3d Clean DONE tags from tests
Remove most of the `===DONE===` tags and its variations.
Keep `===DONE===` if the test output otherwise becomes empty.

Closes GH-4872.
2019-11-07 21:31:47 +01:00

28 lines
531 B
PHP

--TEST--
Reflection on invokable objects
--FILE--
<?php
class Test {
function __invoke($a, $b = 0) { }
}
$rm = new ReflectionMethod(new Test, '__invoke');
var_dump($rm->getName());
var_dump($rm->getNumberOfParameters());
var_dump($rm->getNumberOfRequiredParameters());
$rp = new ReflectionParameter(array(new Test, '__invoke'), 0);
var_dump($rp->isOptional());
$rp = new ReflectionParameter(array(new Test, '__invoke'), 1);
var_dump($rp->isOptional());
?>
--EXPECT--
string(8) "__invoke"
int(2)
int(1)
bool(false)
bool(true)