Anonymous | Login | Signup for a new account | 12-17-2024 08:52 PST |
Main | My View | View Issues | Change Log | Docs |
Viewing Issue Simple Details [ Jump to Notes ] | [ View Advanced ] [ Issue History ] [ Print ] | ||||||||
ID | Category | Severity | Reproducibility | Date Submitted | Last Update | ||||
0005327 | [Quercus] | minor | always | 01-08-13 10:38 | 01-08-13 13:17 | ||||
Reporter | nam | View Status | public | ||||||
Assigned To | nam | ||||||||
Priority | normal | Resolution | fixed | ||||||
Status | closed | Product Version | 4.0.34 | ||||||
Summary | 0005327: object field foreach ordering does not match PHP | ||||||||
Description |
(rep by K. Patel) Using Arrays: Array ( [List] => Array ( [Order0] => Zero [Order1] => One [Order2] => Two [Order3] => Three [Order4] => Four [Order5] => Five [Order6] => Six [Order7] => Seven ) ) $array_yo = array('List' => array('Order0' => 'Zero', 'Order1' => 'One', 'Order2' => 'Two', 'Order3' => 'Three', 'Order4' => 'Four', 'Order5' => 'Five', 'Order6' => 'Six', 'Order7' => 'Seven')); $json_yo = '{"List" : { "Order0" : "Zero", "Order1" : "One", "Order2" : "Two", "Order3" : "Three", "Order4" : "Four", "Order5" : "Five", "Order6" : "Six", "Order7" : "Seven" } }'; $object_yo = (object)array('List' => (object)array('Order0' => 'Zero', 'Order1' => 'One', 'Order2' => 'Two', 'Order3' => 'Three', 'Order4' => 'Four', 'Order5' => 'Five', 'Order6' => 'Six', 'Order7' => 'Seven')); echo '<hr>'; debug_var($array_yo, false, 'Using Arrays'); echo '<strong>The order listed via foreach:</strong> '; foreach ($array_yo['List'] as $row) { debug_var($row); } echo '<hr>'; debug_var($object_yo, false, 'Using stdClass Object'); echo '<strong>The order listed via foreach:</strong> '; foreach ($object_yo->List as $row) { debug_var($row); } |
||||||||
Additional Information | |||||||||
Attached Files | |||||||||
|
There are no notes attached to this issue. |
Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
26 total queries executed. 24 unique queries executed. |