/hphp/test/slow/array_object/natcasesort.php

http://github.com/facebook/hiphop-php · PHP · 21 lines · 17 code · 4 blank · 0 comment · 0 complexity · ef96e6264339147f0eb87577f5c07fd8 MD5 · raw file

  1. <?php
  2. $array = array(
  3. 'IMG0.png',
  4. 'img12.png',
  5. 'img10.png',
  6. 'img2.png',
  7. 'img1.png',
  8. 'IMG3.png'
  9. );
  10. $arr1 = new ArrayObject($array);
  11. $arr2 = clone $arr1;
  12. $arr1->asort();
  13. echo "Standard sorting\n";
  14. print_r($arr1);
  15. $arr2->natcasesort();
  16. echo "\nNatural order sorting (case-insensitive)\n";
  17. print_r($arr2);