remove array_multisort and convert array_multisortN to use inout
[hiphop-php.git] / hphp / test / zend / good / ext / standard / tests / array / array_multisort_variation8.php
blob61e6f32f89fd2eb12b9a1e42d055607765a0c38d
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 { }
17 // Define error handler
18 function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
19 // We're testing sort order not errors so ignore.
21 <<__EntryPoint>> function main(): void {
22 echo "*** Testing array_multisort() : usage variation - test sort order of all types***\n";
24 set_error_handler(fun('test_error_handler'));
26 $inputs = array(
27 'int 0' => 0,
28 'float -10.5' => -10.5,
29 array(),
30 'uppercase NULL' => NULL,
31 'lowercase true' => true,
32 'empty string DQ' => "",
33 'string DQ' => "string",
34 'instance of classWithToString' => new classWithToString(),
35 'instance of classWithoutToString' => new classWithoutToString(),
36 'undefined var' => @$undefined_var,
39 $string = SORT_STRING;
40 var_dump(array_multisort2(inout $inputs, inout $string));
41 var_dump($inputs);
43 echo "===DONE===\n";