1--TEST-- 2Test variations in usage of max() 3--FILE-- 4<?php 5/* 6 * proto mixed max(mixed arg1 [, mixed arg2 [, mixed ...]]) 7 * Function is implemented in ext/standard/array.c 8*/ 9 10echo "\n*** Testing arrays ***\n"; 11 12var_dump(max(array(2,1,2))); 13var_dump(max(array(-2,1,2))); 14var_dump(max(array(2.1,2.11,2.09))); 15var_dump(max(array("", "t", "b"))); 16var_dump(max(array(false, true, false))); 17var_dump(max(array(true, false, true))); 18var_dump(max(array(1, true, false, true))); 19var_dump(max(array(0, true, false, true))); 20var_dump(max(array(0, 1, array(2,3)))); 21var_dump(max(array(2147483645, 2147483646))); 22var_dump(max(array(2147483647, 2147483648))); 23var_dump(max(array(2147483646, 2147483648))); 24var_dump(max(array(-2147483647, -2147483646))); 25var_dump(max(array(-2147483648, -2147483647))); 26var_dump(max(array(-2147483649, -2147483647))); 27 28echo "\nDone\n"; 29 30?> 31--EXPECTF-- 32 33*** Testing arrays *** 34int(2) 35int(2) 36float(2.11) 37string(1) "t" 38bool(true) 39bool(true) 40int(1) 41bool(true) 42array(2) { 43 [0]=> 44 int(2) 45 [1]=> 46 int(3) 47} 48int(2147483646) 49%s(2147483648) 50%s(2147483648) 51int(-2147483646) 52int(-2147483647) 53int(-2147483647) 54 55Done 56