#36502 [Opn->Fbk]: Windows/Linux inconsistency for array_multisort
| From: | tony2001@php.net | Date: | Thu, 23 Feb 2006 22:07:23 +0000 |
| Subject: | #36502 [Opn->Fbk]: Windows/Linux inconsistency for array_multisort | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-93594@lists.php.net to get a copy of this message | ||
ID: 36502
Updated by: tony2001@php.net
Reported By: kevin at theposseltd dot com
-Status: Open
+Status: Feedback
-Bug Type: *General Issues
+Bug Type: Arrays related
Operating System: Linux
PHP Version: 4.4.2
New Comment:
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves.
A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external
resources such as databases, etc.
If possible, make the script source available online and provide
an URL to it here. Try to avoid embedding huge scripts into the report.
Previous Comments:
------------------------------------------------------------------------
[2006-02-23 23:03:42] kevin at theposseltd dot com
Description:
------------
My development system is Windows based (XP)PHP 4.4.0 and after
uploading the code to my hosting server (LINUX PHP 4.4.2) I get error
messages when running the code, which worked fine on Windows. Nobody
seems to be able to help me - so I suspect it may be a bug or
inconsistency between 4.4.0 and 4.4.2
I am trying to sort a multidimensional array using array_multisort -
the coding works perfectly on my development system but not on the
Linux host site.
Reproduce code:
---------------
array structure looks like ... (line taken from actual structure)
[17] => Array ( [0] => 98 [event_ID] => 98 [1] => 5 [event_code] => 5
[2] => 0 [event_SIG_code] => 0 [3] => Attraction [event_type] =>
Attraction [4] => Lookout Discovery Centre [event_name] => Lookout
Discovery Centre [5] => Party [event_description] => Party [6] =>
OmVMYV [event_geocode] => OmVMYV [7] => RG12 7QW [event_postcode] =>
RG12 7QW [8] => 2005-10-07 [event_start_date] => 2005-10-07 [distance]
=> Array ( [kilometers] => 43.55 [meters] => 43545.49 [miles] => 27.06
[furlongs] => 216.46 [feet] => 142865.79 [yards] => 47621.93 [inches]
=> 1714389.5 [nautical] => 23.51 [error] => 0 ) )
Code causing the issue ...
foreach ($sort_result as $res) {
$sortAux[] = $res['event_code'];
array_multisort($sortAux, SORT_ASC,$sort_result);}
// Re-sorts the GeoCode array by event_code
Expected result:
----------------
Expect the array to be sorted by 'event_code'(as it does in Windows
system)
Actual result:
--------------
Actual error output:
Warning: array_multisort(): Array sizes are inconsistent in
/content/StartupHostPlus/t/e/tellmewhatson.co.uk/web/event_headline_search.php
on line 65
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=36502&edit=1