From:             mattsch at gmail dot com
Operating system: Linux
PHP version:      5.1.2
PHP Bug Type:     Arrays related
Bug description:  array_multisort reports inconsistent warning when arrays are 
consistent

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.

-- 
Edit bug report at http://bugs.php.net/?id=37210&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=37210&r=trysnapshot44
Try a CVS snapshot (PHP 5.1): 
http://bugs.php.net/fix.php?id=37210&r=trysnapshot51
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=37210&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=37210&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=37210&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=37210&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=37210&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=37210&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=37210&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=37210&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=37210&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=37210&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=37210&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=37210&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=37210&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=37210&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=37210&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=37210&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=37210&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=37210&r=mysqlcfg

Reply via email to