]> granicus.if.org Git - php/commitdiff
add test
authorAntony Dovgal <tony2001@php.net>
Tue, 22 Aug 2006 19:51:34 +0000 (19:51 +0000)
committerAntony Dovgal <tony2001@php.net>
Tue, 22 Aug 2006 19:51:34 +0000 (19:51 +0000)
ext/standard/tests/strings/implode1.phpt [new file with mode: 0644]

diff --git a/ext/standard/tests/strings/implode1.phpt b/ext/standard/tests/strings/implode1.phpt
new file mode 100644 (file)
index 0000000..1aff3d8
--- /dev/null
@@ -0,0 +1,99 @@
+--TEST--
+implode() and various args 
+--FILE--
+<?php
+
+$a = array(
+       array(1,2),
+       array(1.1,2.2),
+       array(array(2),array(1)),
+       array(false,true),
+       );
+
+foreach ($a as $val) {
+       var_dump(implode(', ', $val));
+       var_dump($val);
+}
+
+echo "Done\n";
+?>
+--EXPECTF--    
+string(4) "1, 2"
+array(2) {
+  [0]=>
+  int(1)
+  [1]=>
+  int(2)
+}
+string(8) "1.1, 2.2"
+array(2) {
+  [0]=>
+  float(1.1)
+  [1]=>
+  float(2.2)
+}
+
+Notice: Array to string conversion in %s on line %d
+
+Notice: Array to string conversion in %s on line %d
+string(12) "Array, Array"
+array(2) {
+  [0]=>
+  array(1) {
+    [0]=>
+    int(2)
+  }
+  [1]=>
+  array(1) {
+    [0]=>
+    int(1)
+  }
+}
+string(3) ", 1"
+array(2) {
+  [0]=>
+  bool(false)
+  [1]=>
+  bool(true)
+}
+Done
+--UEXPECTF--
+unicode(4) "1, 2"
+array(2) {
+  [0]=>
+  int(1)
+  [1]=>
+  int(2)
+}
+unicode(8) "1.1, 2.2"
+array(2) {
+  [0]=>
+  float(1.1)
+  [1]=>
+  float(2.2)
+}
+
+Notice: Array to string conversion in %s on line %d
+
+Notice: Array to string conversion in %s on line %d
+unicode(12) "Array, Array"
+array(2) {
+  [0]=>
+  array(1) {
+    [0]=>
+    int(2)
+  }
+  [1]=>
+  array(1) {
+    [0]=>
+    int(1)
+  }
+}
+unicode(3) ", 1"
+array(2) {
+  [0]=>
+  bool(false)
+  [1]=>
+  bool(true)
+}
+Done