summaryrefslogtreecommitdiff
path: root/tests/lang/bug25547.phpt
blob: b54f467ea8752ce8068724d3a86efff88d0c9adb (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
30
--TEST--
Bug #25547 (error_handler and array index with function call)
--FILE--
<?php

function handler($errno, $errstr, $errfile, $errline, $context)
{
	echo __FUNCTION__ . "($errstr)\n";
}

set_error_handler('handler');

function foo($x) {
	return "foo";
}

$output = array();
++$output[foo("bar")];

print_r($output);

echo "Done";
?>
--EXPECT--
handler(Undefined index: foo)
Array
(
    [foo] => 1
)
Done