php-src/ext/standard/tests/array/max_error.phpt
2007-10-26 11:01:35 +00:00

35 lines
641 B
PHP

--TEST--
Test wrong number of arguments for min()
--INI--
--FILE--
<?php
/*
* proto mixed min(mixed arg1 [, mixed arg2 [, mixed ...]])
* Function is implemented in ext/standard/array.c
*/
echo "\n*** Testing Error Conditions ***\n";
var_dump(max());
var_dump(max(1));
var_dump(max(array()));
var_dump(max(new stdclass));
?>
--EXPECTF--
*** Testing Error Conditions ***
Warning: max(): At%seast one %s on line %d
NULL
Warning: Wrong parameter count for max() in %s on line %d
NULL
Warning: max(): Array must contain at%seast one element in %s on line %d
bool(false)
Warning: Wrong parameter count for max() in %s on line %d
NULL