blob: 682a0f5e322815e0089569351800d4b3390164c8 (
plain)
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
|
--TEST--
Reflection::getClosureScopeClass()
--SKIPIF--
<?php
if (!extension_loaded('reflection')) print 'skip';
?>
--FILE--
<?php
$closure = function($param) { return "this is a closure"; };
$rf = new ReflectionFunction($closure);
var_dump($rf->getClosureScopeClass());
Class A {
public static function getClosure() {
return function($param) { return "this is a closure"; };
}
}
$closure = A::getClosure();
$rf = new ReflectionFunction($closure);
var_dump($rf->getClosureScopeClass());
echo "Done!\n";
--EXPECTF--
NULL
object(ReflectionClass)#%d (1) {
["name"]=>
string(1) "A"
}
Done!
|