introduce array_multisort1, ..., array_multisort9
[hiphop-php.git] / hphp / test / zend / good / ext / standard / tests / array / array_multisort_variation7.php
blob9ccaddb9b8f506a2c50b02ab131c0e1dec2ca7f1
1 <?hh
2 /* Prototype : bool array_multisort(array ar1 [, SORT_ASC|SORT_DESC [, SORT_REGULAR|SORT_NUMERIC|SORT_STRING|SORT_NATURAL|SORT_FLAG_CASE]] [, array ar2 [, SORT_ASC|SORT_DESC [, SORT_REGULAR|SORT_NUMERIC|SORT_STRING|SORT_NATURAL|SORT_FLAG_CASE]], ...])
3 * Description: Sort multiple arrays at once similar to how ORDER BY clause works in SQL
4 * Source code: ext/standard/array.c
5 * Alias to functions:
6 */
8 // define some classes
9 class classWithToString {
10 public function __toString() {
11 return "Class A object";
15 class classWithoutToString { }
16 <<__EntryPoint>> function main(): void {
17 echo "*** Testing array_multisort() : usage variation - test sort order of all types***\n";
19 $inputs = array(
20 'int 0' => 0,
21 'float -10.5' => -10.5,
22 array(),
23 'uppercase NULL' => NULL,
24 'lowercase true' => true,
25 'empty string DQ' => "",
26 'string DQ' => "string",
27 'instance of classWithToString' => new classWithToString(),
28 'instance of classWithoutToString' => new classWithoutToString(),
29 'undefined var' => @$undefined_var,
32 var_dump(array_multisort1(&$inputs));
33 var_dump($inputs);
35 echo "===DONE===\n";