xref: /PHP-5.3/Zend/tests/closure_019.phpt (revision a142b6cd)
1--TEST--
2Closure 019: Calling lambda using $GLOBALS and global $var
3--FILE--
4<?php
5
6$lambda = function &(&$x) {
7	return $x = $x * $x;
8};
9
10function test() {
11	global $lambda;
12
13	$y = 3;
14	var_dump($GLOBALS['lambda']($y));
15	var_dump($lambda($y));
16	var_dump($GLOBALS['lambda'](1));
17}
18
19test();
20
21?>
22--EXPECTF--
23int(9)
24int(81)
25
26Fatal error: Cannot pass parameter 1 by reference in %s on line %d
27