summaryrefslogtreecommitdiff
path: root/ext/standard/tests/array/max_error.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/standard/tests/array/max_error.phpt')
-rw-r--r--ext/standard/tests/array/max_error.phpt32
1 files changed, 32 insertions, 0 deletions
diff --git a/ext/standard/tests/array/max_error.phpt b/ext/standard/tests/array/max_error.phpt
new file mode 100644
index 0000000..b20a3c0
--- /dev/null
+++ b/ext/standard/tests/array/max_error.phpt
@@ -0,0 +1,32 @@
+--TEST--
+Test wrong number of arguments for min()
+--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() expects at least 1 parameter, 0 given in %s on line 10
+NULL
+
+Warning: max(): When only one parameter is given, it must be an array in %s on line 11
+NULL
+
+Warning: max(): Array must contain at least one element in %s on line 12
+bool(false)
+
+Warning: max(): When only one parameter is given, it must be an array in %s on line 13
+NULL