blob: 2762ebd8309477ed11e4ffb2f348a3e12fcbd13d (
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--
Crash when function parameter modified via reference
--FILE--
<?php
function usercompare($a,$b) {
unset($GLOBALS['my_var'][2]);
return $a <=> $b;
}
$my_var = array(1 => "entry_1",
2 => "entry_2",
3 => "entry_3",
4 => "entry_4",
5 => "entry_5");
usort($my_var, "usercompare");
var_dump($my_var);
?>
--EXPECT--
array(5) {
[0]=>
string(7) "entry_1"
[1]=>
string(7) "entry_2"
[2]=>
string(7) "entry_3"
[3]=>
string(7) "entry_4"
[4]=>
string(7) "entry_5"
}
|