It's interesting to note that when creating an array with numeric keys in no particular order, end() will still only return the value that was the last one to be created. So, if you have something like this:
<?php
$a = array();
$a[1] = 1;
$a[0] = 0;
echo end($a);
?>
This will print "0".