|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-04-26 16:52 UTC] mattsch at gmail dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 19 07:00:01 2025 UTC |
Description: ------------ array_multisort reports this warning on arrays in which the sizes are consistent: Warning: array_multisort() [function.array-multisort]: Array sizes are inconsistent in /home/www/rootsite_staging/reports/index.php on line Reproduce code: --------------- <?php $selectedReports = array ( 'file' => array ( 0 => '/home/www/staging/reports/Daily Reports/DMR/2006/04_April2006/20060417_DAY.xls', 1 => '/home/www/staging/reports/Daily Reports/Payroll/2006/04_April2006/20060417_DailyPayroll.xls', 2 => '/home/www/staging/reports/Daily Reports/DMR/2006/04_April2006/20060418_DAY.xls', 3 => '/home/www/staging/reports/Daily Reports/Payroll/2006/04_April2006/20060418_DailyPayroll.xls', 4 => '/home/www/staging/reports/Daily Reports/DMR/2006/04_April2006/20060419_DAY.xls', 5 => '/home/www/staging/reports/Daily Reports/Payroll/2006/04_April2006/20060419_DailyPayroll.xls', 6 => '/home/www/staging/reports/Daily Reports/DMR/2006/04_April2006/20060420_DAY.xls', 7 => '/home/www/staging/reports/Daily Reports/DMR/2006/04_April2006/20060420_DAY_r1.xls', 8 => '/home/www/staging/reports/Daily Reports/Payroll/2006/04_April2006/20060420_DailyPayroll.xls', 9 => '/home/www/staging/reports/Daily Reports/Payroll/2006/04_April2006/20060420_DailyPayroll_r1.xls', 10 => '/home/www/staging/reports/Daily Reports/DMR/2006/04_April2006/20060421_DAY.xls', ), 'date' => array ( 0 => '2006-04-17', 1 => '2006-04-17', 2 => '2006-04-18', 3 => '2006-04-18', 4 => '2006-04-19', 5 => '2006-04-19', 6 => '2006-04-20', 7 => '2006-04-20', 8 => '2006-04-20', 9 => '2006-04-20', 10 => '2006-04-21', ), 'revision' => array ( 0 => 0, 1 => 0, 2 => 0, 3 => 0, 4 => 0, 5 => 0, 6 => 0, 7 => 1, 8 => 0, 9 => 1, 10 => 0, ), 'report' => array ( 0 => 'Daily Manager Report', 1 => 'Payroll Report', 2 => 'Daily Manager Report', 3 => 'Payroll Report', 4 => 'Daily Manager Report', 5 => 'Payroll Report', 6 => 'Daily Manager Report', 7 => 'Daily Manager Report', 8 => 'Payroll Report', 9 => 'Payroll Report', 10 => 'Daily Manager Report', ), ); array_multisort($selectedReports['date'], $selectedReports['report'], $selectedReports['revision'], SORT_DESC, $selectedReports['file'], $selectedReports); ?> Expected result: ---------------- The size of each dimension dimension being sorted are consistent. I've checked it and rechecked it and even looped over it (no index error). It should not report an inconsistent warning. Actual result: -------------- Does not sort and reports an inconsistent size warning.