summaryrefslogtreecommitdiff
path: root/Zend/tests/anonymous_func_002.phpt
blob: 28adc357dab8febfa13a3e8805b6eb10e8dc2251 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
--TEST--
Testing anonymous function return as array key and accessing $GLOBALS
--FILE--
<?php

$test = create_function('$v', 'return $v;');

$arr = array(create_function('', 'return $GLOBALS["arr"];'), 2);

var_dump($arr[$test(1)]);
var_dump($arr[$test(0)]() == $arr);

?>
--EXPECTF--
Deprecated: Function create_function() is deprecated in %s on line %d

Deprecated: Function create_function() is deprecated in %s on line %d
int(2)
bool(true)