Skip to content

Instantly share code, notes, and snippets.

@flyx
Created April 9, 2012 14:58
Show Gist options
  • Save flyx/2344060 to your computer and use it in GitHub Desktop.
Save flyx/2344060 to your computer and use it in GitHub Desktop.
PHP doesn't care about array index ordering (expected output: "hurrdurrwarbl"; actual output: "hurrwarbldurr")
<?php
$arr = array();
$arr[0] = "hurr";
$arr[2] = "warbl";
$arr[1] = "durr";
foreach($arr as $item) {
echo $item;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment