1--TEST-- 2Crash when function parameter modified via reference 3--FILE-- 4<?php 5function usercompare($a,$b) { 6 unset($GLOBALS['my_var'][2]); 7 return $a <=> $b; 8} 9$my_var = array(1 => "entry_1", 102 => "entry_2", 113 => "entry_3", 124 => "entry_4", 135 => "entry_5"); 14usort($my_var, "usercompare"); 15var_dump($my_var); 16 17?> 18--EXPECT-- 19array(5) { 20 [0]=> 21 string(7) "entry_1" 22 [1]=> 23 string(7) "entry_2" 24 [2]=> 25 string(7) "entry_3" 26 [3]=> 27 string(7) "entry_4" 28 [4]=> 29 string(7) "entry_5" 30} 31