usort(): Array was modified by the user comparison function

后端 未结 4 2003
遇见更好的自我
遇见更好的自我 2020-12-14 00:32

I have a web application that runs fine on our Linux servers but when running on Mac OS with the Zend Community Edition Server using PHP 5.3 we get the error:

4条回答
  •  被撕碎了的回忆
    2020-12-14 00:43

    To resolve this issue we can handle as below

    1) use error_reporting

    $a = array('id' => 2,'val' => 3, 'ind' => 3);
    $errorReporting = error_reporting(0);
    usort($a);
    error_reporting($errorReporting);
    

    2) use @usort($a);

    $a = array('id' => 2,'val' => 3, 'ind' => 3);
    @usort($a);
    

提交回复
热议问题