File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / standard / tests / array / max.phpt
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Feb 21 23:48:03 2012 UTC (12 years, 8 months ago) by misho
Branches: php, MAIN
CVS tags: v5_4_3elwix, v5_4_29p0, v5_4_29, v5_4_20p0, v5_4_20, v5_4_17p0, v5_4_17, v5_3_10, HEAD
php

--TEST--
max() tests
--INI--
precision=14
--FILE--
<?php

var_dump(max());
var_dump(max(1));
var_dump(max(array()));
var_dump(max(new stdclass));
var_dump(max(2,1,2));
var_dump(max(2.1,2.11,2.09));
var_dump(max("", "t", "b"));
var_dump(max(false, true, false));
var_dump(max(true, false, true));
var_dump(max(1, true, false, true));
var_dump(max(0, true, false, true));

echo "Done\n";
?>
--EXPECTF--	
Warning: max() expects at least 1 parameter, 0 given in %s on line 3
NULL

Warning: max(): When only one parameter is given, it must be an array in %s on line 4
NULL

Warning: max(): Array must contain at least one element in %s on line 5
bool(false)

Warning: max(): When only one parameter is given, it must be an array in %s on line 6
NULL
int(2)
float(2.11)
string(1) "t"
bool(true)
bool(true)
int(1)
bool(true)
Done

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>