summaryrefslogtreecommitdiff
path: root/ext/standard/tests/array/array_unshift.phpt
diff options
context:
space:
mode:
authorAntony Dovgal <tony2001@php.net>2006-11-15 22:44:29 +0000
committerAntony Dovgal <tony2001@php.net>2006-11-15 22:44:29 +0000
commitd1acb8d4ebd5b7bf2b7ec2e1f2a4b79a6f038f02 (patch)
tree6ad1eaf4424b917014c1b19e8503390878e3d799 /ext/standard/tests/array/array_unshift.phpt
parenteca1911b72e034e0e807ce3786a6a02ca17d71b9 (diff)
downloadphp-git-d1acb8d4ebd5b7bf2b7ec2e1f2a4b79a6f038f02.tar.gz
add new tests, improve existing ones
Diffstat (limited to 'ext/standard/tests/array/array_unshift.phpt')
-rw-r--r--ext/standard/tests/array/array_unshift.phpt40
1 files changed, 40 insertions, 0 deletions
diff --git a/ext/standard/tests/array/array_unshift.phpt b/ext/standard/tests/array/array_unshift.phpt
new file mode 100644
index 0000000000..0e8dae9196
--- /dev/null
+++ b/ext/standard/tests/array/array_unshift.phpt
@@ -0,0 +1,40 @@
+--TEST--
+array_unshift() tests
+--FILE--
+<?php
+
+$a = array();
+$s = "";
+var_dump(array_unshift($a, $s));
+var_dump($a);
+var_dump(array_unshift($s, $a));
+var_dump($a);
+var_dump(array_unshift($a, $a));
+var_dump($a);
+
+echo "Done\n";
+?>
+--EXPECTF--
+int(1)
+array(1) {
+ [0]=>
+ string(0) ""
+}
+
+Warning: array_unshift(): The first argument should be an array in %s on line %d
+bool(false)
+array(1) {
+ [0]=>
+ string(0) ""
+}
+int(2)
+array(2) {
+ [0]=>
+ array(1) {
+ [0]=>
+ string(0) ""
+ }
+ [1]=>
+ string(0) ""
+}
+Done