1--TEST--
2Reflection on invocable objects
3--FILE--
4<?php
5
6class Test {
7    function __invoke($a, $b = 0) { }
8}
9
10$rm = new ReflectionMethod(new Test, '__invoke');
11var_dump($rm->getName());
12var_dump($rm->getNumberOfParameters());
13var_dump($rm->getNumberOfRequiredParameters());
14
15$rp = new ReflectionParameter(array(new Test, '__invoke'), 0);
16var_dump($rp->isOptional());
17
18$rp = new ReflectionParameter(array(new Test, '__invoke'), 1);
19var_dump($rp->isOptional());
20
21?>
22--EXPECT--
23string(8) "__invoke"
24int(2)
25int(1)
26bool(false)
27bool(true)
28