PageRenderTime 33ms CodeModel.GetById 13ms RepoModel.GetById 0ms app.codeStats 0ms

/hphp/test/slow/array_object/natsort.php

http://github.com/facebook/hiphop-php
PHP | 14 lines | 10 code | 4 blank | 0 comment | 0 complexity | d742beb07ad17a1a8bd8a9538fe3ec38 MD5 | raw file
Possible License(s): LGPL-2.1, BSD-2-Clause, BSD-3-Clause, MPL-2.0-no-copyleft-exception, MIT, LGPL-2.0, Apache-2.0
  1. <?php
  2. $array = array("img12.png", "img10.png", "img2.png", "img1.png");
  3. $arr1 = new ArrayObject($array);
  4. $arr2 = clone $arr1;
  5. $arr1->asort();
  6. echo "Standard sorting\n";
  7. print_r($arr1);
  8. $arr2->natsort();
  9. echo "\nNatural order sorting\n";
  10. print_r($arr2);