summaryrefslogtreecommitdiff
path: root/ext/reflection/tests/ReflectionFunction_getClosureScopeClass.phpt
blob: b8b969b0bc9108aa1648f556547e1527282cc547 (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
--TEST--
Reflection::getClosureScopeClass()
--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!