There is a PHP error that may trigger this warning even if you do not modify the array.
The short version, if any PHP debugging functions examine the sorting array, they will change the number of links and the usort() trick, thinking that you have changed the data.
So, you will get this warning by doing any of the following in your sort function (or any of the codes called from it):
- calling
var_dump or print_r for any of the sort data - call
debug_backtrace() - throwing an exception - any exception - or even just throwing an exception
Error https://bugs.php.net/bug.php?id=50688 It affects all versions of PHP> = 5.2.11 (including 5.3. * And probably 5. * and 6).
As of January 2015, it is still open.
As far as I can tell, the only workaround is to either "not do this" (which is pretty difficult for exceptions), or use the @usort() error suppression operator to ignore all errors.
Achronos Jun 11 '12 at 18:23 2012-06-11 18:23
source share