-
Notifications
You must be signed in to change notification settings - Fork 8k
Expand file tree
/
Copy pathgh17126.phpt
More file actions
48 lines (43 loc) · 811 Bytes
/
gh17126.phpt
File metadata and controls
48 lines (43 loc) · 811 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
--TEST--
GH-17126 (get_class_methods($closure) doesn't return __invoke)
--FILE--
<?php
$closure = fn (string $str) => "hello {$str}";
echo "from object:\n";
$methods = get_class_methods($closure);
sort($methods);
print_r($methods);
echo "from class name:\n";
$methods = get_class_methods('Closure');
sort($methods);
print_r($methods);
echo "unrelated class unaffected:\n";
class NoInvoke { public function foo() {} }
print_r(get_class_methods('NoInvoke'));
?>
--EXPECT--
from object:
Array
(
[0] => __invoke
[1] => bind
[2] => bindTo
[3] => call
[4] => fromCallable
[5] => getCurrent
)
from class name:
Array
(
[0] => __invoke
[1] => bind
[2] => bindTo
[3] => call
[4] => fromCallable
[5] => getCurrent
)
unrelated class unaffected:
Array
(
[0] => foo
)