/hphp/test/zend/good/ext/standard/tests/array/natsort_basic.php
PHP | 14 lines | 10 code | 0 blank | 4 comment | 0 complexity | df0fa6cc30ccc272b819f834e00f2634 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
- <?hh
- /*
- * proto bool natsort ( array &$array )
- * Function is implemented in ext/standard/array.c
- */
- <<__EntryPoint>> function main(): void {
- $array1 = $array2 = varray["img12.png", "img10.png", "img2.png", "img1.png"];
- sort(inout $array1);
- echo "Standard sorting\n";
- print_r($array1);
- natsort(inout $array2);
- echo "\nNatural order sorting\n";
- print_r($array2);
- }