|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2009-08-12 22:25 UTC] yakucorp at gmail dot com
Description:
------------
I just upgrade my php v to 5.3 and it appears this error.
this is my old script, and returns error like this
Reproduce code:
---------------
function fn_array_multisort()
{
$n = func_num_args();
$ar = func_get_arg(0);
if(!is_array($ar)){
return false;
}
for($i = 1; $i < $n; $i++){
$col[$i] = func_get_arg($i);
}
foreach($ar as $key => $val){
foreach($col as $kkey => $vval){
if(is_string($vval)){
${"subar$kkey"}[$key] = isset($val[$vval]) ? $val[$vval] : '';
}
}
}
$arv = array();
foreach($col as $key => $val){
$arv[] = (is_string($val) ? ${"subar$key"} : $val);
}
$arv[] = $ar;
call_user_func_array("array_multisort", $arv);
return $ar;
}
Expected result:
----------------
Warning: Parameter 1 to array_multisort() expected to be a reference, value given in /usr/local/nginx/html/fox/core/fn_common.php on line 2000
Warning: Parameter 1 to array_multisort() expected to be a reference, value given in /usr/local/nginx/html/fox/core/fn_common.php on line 2000
Warning: Parameter 1 to array_multisort() expected to be a reference, value given in /usr/local/nginx/html/fox/core/fn_common.php on line 2000
Warning: Parameter 1 to array_multisort() expected to be a reference, value given in /usr/local/nginx/html/fox/core/fn_common.php on line 2000
Warning: Parameter 1 to array_multisort() expected to be a reference, value given in /usr/local/nginx/html/fox/core/fn_common.php on line 2000
Actual result:
--------------
call_user_func_array("array_multisort", $arv);
this line might be the clue call_user_func_array("array_multisort", $arv);
please help, thanks
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 09:00:01 2025 UTC |
Thanks for fast reply, then how to fix it? i just delete call_user_func_array("array_multisort", $arv); and the error is not appears, but how to fix this thing? thanks