1--TEST-- 2Test array_multisort() function : usage variation - test sort order of all types 3--FILE-- 4<?php 5echo "*** Testing array_multisort() : usage variation - test sort order of all types***\n"; 6 7// define some classes 8class classWithToString { 9 public function __toString() { 10 return "Class A object"; 11 } 12} 13 14class classWithoutToString { } 15 16$inputs = array( 17 'int 0' => 0, 18 'float -10.5' => -10.5, 19 array(), 20 'uppercase NULL' => NULL, 21 'lowercase true' => true, 22 'empty string DQ' => "", 23 'string DQ' => "string", 24 'instance of classWithToString' => new classWithToString(), 25 'instance of classWithoutToString' => new classWithoutToString(), 26 'undefined var' => @$undefined_var, 27); 28 29var_dump(array_multisort($inputs)); 30var_dump($inputs); 31 32?> 33--EXPECT-- 34*** Testing array_multisort() : usage variation - test sort order of all types*** 35bool(true) 36array(10) { 37 ["float -10.5"]=> 38 float(-10.5) 39 ["int 0"]=> 40 int(0) 41 [0]=> 42 array(0) { 43 } 44 ["uppercase NULL"]=> 45 NULL 46 ["empty string DQ"]=> 47 string(0) "" 48 ["undefined var"]=> 49 NULL 50 ["lowercase true"]=> 51 bool(true) 52 ["instance of classWithToString"]=> 53 object(classWithToString)#1 (0) { 54 } 55 ["string DQ"]=> 56 string(6) "string" 57 ["instance of classWithoutToString"]=> 58 object(classWithoutToString)#2 (0) { 59 } 60} 61