summaryrefslogtreecommitdiff
path: root/ext/standard/tests/strings/implode1.phpt
blob: c1c1599eb7b56c5ddfb62286e2a2a0b696ca0938 (plain)
ofshex dumpascii
0000 2d 2d 54 45 53 54 2d 2d 0a 54 65 73 74 20 69 6d 70 6c 6f 64 65 28 29 20 66 75 6e 63 74 69 6f 6e --TEST--.Test.implode().function
0020 0a 2d 2d 46 49 4c 45 2d 2d 0a 3c 3f 70 68 70 0a 65 63 68 6f 20 22 2a 2a 2a 20 54 65 73 74 69 6e .--FILE--.<?php.echo."***.Testin
0040 67 20 69 6d 70 6c 6f 64 65 28 29 20 66 6f 72 20 62 61 73 69 63 20 6f 70 65 72 61 74 69 6f 6e 73 g.implode().for.basic.operations
0060 20 2a 2a 2a 5c 6e 22 3b 0a 24 61 72 72 61 79 73 20 3d 20 61 72 72 61 79 20 28 0a 20 20 61 72 72 .***\n";.$arrays.=.array.(...arr
0080 61 79 28 31 2c 32 29 2c 0a 20 20 61 72 72 61 79 28 31 2e 31 2c 32 2e 32 29 2c 0a 20 20 61 72 72 ay(1,2),...array(1.1,2.2),...arr
00a0 61 79 28 61 72 72 61 79 28 32 29 2c 61 72 72 61 79 28 31 29 29 2c 0a 20 20 61 72 72 61 79 28 66 ay(array(2),array(1)),...array(f
00c0 61 6c 73 65 2c 74 72 75 65 29 2c 0a 20 20 61 72 72 61 79 28 29 2c 0a 20 20 61 72 72 61 79 28 22 alse,true),...array(),...array("
00e0 61 22 2c 22 61 61 61 61 22 2c 22 62 22 2c 22 62 62 62 62 22 2c 22 63 22 2c 22 63 63 63 63 63 63 a","aaaa","b","bbbb","c","cccccc
0100 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 22 29 0a 29 3b 0a 2f 2a 20 6c 6f 6f 70 20 74 6f 20 ccccccccccccccc").);./*.loop.to.
0120 6f 75 74 70 75 74 20 73 74 72 69 6e 67 20 77 69 74 68 20 27 2c 20 27 20 61 73 20 24 67 6c 75 65 output.string.with.',.'.as.$glue
0140 2c 20 75 73 69 6e 67 20 69 6d 70 6c 6f 64 65 28 29 20 2a 2f 0a 66 6f 72 65 61 63 68 20 28 24 61 ,.using.implode().*/.foreach.($a
0160 72 72 61 79 73 20 61 73 20 24 61 72 72 61 79 29 20 7b 0a 20 20 76 61 72 5f 64 75 6d 70 28 20 69 rrays.as.$array).{...var_dump(.i
0180 6d 70 6c 6f 64 65 28 27 2c 20 27 2c 20 24 61 72 72 61 79 29 20 29 3b 0a 20 20 76 61 72 5f 64 75 mplode(',.',.$array).);...var_du
01a0 6d 70 28 24 61 72 72 61 79 29 3b 0a 7d 0a 0a 65 63 68 6f 20 22 5c 6e 2a 2a 2a 20 54 65 73 74 69 mp($array);.}..echo."\n***.Testi
01c0 6e 67 20 69 6d 70 6c 6f 64 65 28 29 20 77 69 74 68 20 76 61 72 69 61 74 69 6f 6e 73 20 6f 66 20 ng.implode().with.variations.of.
01e0 67 6c 75 65 20 2a 2a 2a 5c 6e 22 3b 0a 2f 2a 20 63 68 65 63 6b 69 6e 67 20 70 6f 73 73 69 62 6c glue.***\n";./*.checking.possibl
0200 65 20 76 61 72 69 61 74 69 6f 6e 73 20 2a 2f 0a 24 70 69 65 63 65 73 20 3d 20 61 72 72 61 79 20 e.variations.*/.$pieces.=.array.
0220 28 0a 20 20 32 2c 0a 20 20 30 2c 0a 20 20 2d 36 33 39 2c 0a 20 20 74 72 75 65 2c 0a 20 20 22 50 (...2,...0,...-639,...true,..."P
0240 48 50 22 2c 0a 20 20 66 61 6c 73 65 2c 0a 20 20 4e 55 4c 4c 2c 0a 20 20 22 22 2c 0a 20 20 22 20 HP",...false,...NULL,..."",...".
0260 22 2c 0a 20 20 22 73 74 72 69 6e 67 5c 78 30 30 77 69 74 68 5c 78 30 30 2e 2e 2e 5c 30 22 0a 29 ",..."string\x00with\x00...\0".)
0280 3b 0a 24 67 6c 75 65 73 20 3d 20 61 72 72 61 79 20 28 0a 20 20 22 54 52 55 45 22 2c 0a 20 20 74 ;.$glues.=.array.(..."TRUE",...t
02a0 72 75 65 2c 0a 20 20 66 61 6c 73 65 2c 0a 20 20 61 72 72 61 79 28 22 6b 65 79 31 22 2c 20 22 6b rue,...false,...array("key1",."k
02c0 65 79 32 22 29 2c 0a 20 20 22 22 2c 0a 20 20 22 20 22 2c 0a 20 20 22 73 74 72 69 6e 67 5c 78 30 ey2"),..."",...".",..."string\x0
02e0 30 62 65 74 77 65 65 6e 22 2c 0a 20 20 4e 55 4c 4c 2c 0a 20 20 2d 30 2c 0a 20 20 27 5c 30 27 0a 0between",...NULL,...-0,...'\0'.
0300 29 3b 0a 2f 2a 20 6c 6f 6f 70 20 74 68 72 6f 75 67 68 20 74 6f 20 64 69 73 70 6c 61 79 20 61 20 );./*.loop.through.to.display.a.
0320 73 74 72 69 6e 67 20 63 6f 6e 74 61 69 6e 69 6e 67 20 61 6c 6c 20 74 68 65 20 61 72 72 61 79 20 string.containing.all.the.array.
0340 24 70 69 65 63 65 73 20 69 6e 20 74 68 65 20 73 61 6d 65 20 6f 72 64 65 72 2c 0a 20 20 20 77 69 $pieces.in.the.same.order,....wi
0360 74 68 20 74 68 65 20 24 67 6c 75 65 20 73 74 72 69 6e 67 20 62 65 74 77 65 65 6e 20 65 61 63 68 th.the.$glue.string.between.each
0380 20 65 6c 65 6d 65 6e 74 20 20 2a 2f 0a 24 63 6f 75 6e 74 65 72 20 3d 20 31 3b 0a 66 6f 72 65 61 .element..*/.$counter.=.1;.forea
03a0 63 68 28 24 67 6c 75 65 73 20 61 73 20 24 67 6c 75 65 29 20 7b 0a 20 20 65 63 68 6f 20 22 2d 2d ch($glues.as.$glue).{...echo."--
03c0 20 49 74 65 72 61 74 69 6f 6e 20 24 63 6f 75 6e 74 65 72 20 2d 2d 5c 6e 22 3b 0a 20 20 74 72 79 .Iteration.$counter.--\n";...try
03e0 20 7b 0a 20 20 20 20 20 20 20 76 61 72 5f 64 75 6d 70 28 69 6d 70 6c 6f 64 65 28 24 67 6c 75 65 .{........var_dump(implode($glue
0400 2c 20 24 70 69 65 63 65 73 29 29 3b 0a 20 20 7d 20 63 61 74 63 68 20 28 54 79 70 65 45 72 72 6f ,.$pieces));...}.catch.(TypeErro
0420 72 20 24 65 78 63 65 70 74 69 6f 6e 29 20 7b 0a 20 20 20 20 20 20 65 63 68 6f 20 24 65 78 63 65 r.$exception).{.......echo.$exce
0440 70 74 69 6f 6e 2d 3e 67 65 74 4d 65 73 73 61 67 65 28 29 20 2e 20 22 5c 6e 22 3b 0a 20 20 7d 0a ption->getMessage()..."\n";...}.
0460 20 20 24 63 6f 75 6e 74 65 72 2b 2b 3b 0a 7d 0a 0a 2f 2a 20 65 6d 70 74 79 20 73 74 72 69 6e 67 ..$counter++;.}../*.empty.string
0480 20 2a 2f 0a 65 63 68 6f 20 22 5c 6e 2a 2a 2a 20 54 65 73 74 69 6e 67 20 69 6d 70 6c 6f 64 65 28 .*/.echo."\n***.Testing.implode(
04a0 29 20 6f 6e 20 65 6d 70 74 79 20 73 74 72 69 6e 67 20 2a 2a 2a 5c 6e 22 3b 0a 74 72 79 20 7b 0a ).on.empty.string.***\n";.try.{.
04c0 20 20 20 20 69 6d 70 6c 6f 64 65 28 22 22 29 3b 0a 7d 20 63 61 74 63 68 20 28 54 79 70 65 45 72 ....implode("");.}.catch.(TypeEr
04e0 72 6f 72 20 24 65 29 20 7b 0a 20 20 20 20 65 63 68 6f 20 24 65 2d 3e 67 65 74 4d 65 73 73 61 67 ror.$e).{.....echo.$e->getMessag
0500 65 28 29 2c 20 22 5c 6e 22 3b 0a 7d 0a 0a 2f 2a 20 63 68 65 63 6b 69 6e 67 20 73 75 62 2d 61 72 e(),."\n";.}../*.checking.sub-ar
0520 72 61 79 73 20 2a 2f 0a 65 63 68 6f 20 22 5c 6e 2a 2a 2a 20 54 65 73 74 69 6e 67 20 69 6d 70 6c rays.*/.echo."\n***.Testing.impl
0540 6f 64 65 28 29 20 6f 6e 20 73 75 62 2d 61 72 72 61 79 73 20 2a 2a 2a 5c 6e 22 3b 0a 24 73 75 62 ode().on.sub-arrays.***\n";.$sub
0560 5f 61 72 72 61 79 20 3d 20 61 72 72 61 79 28 61 72 72 61 79 28 31 2c 32 2c 33 2c 34 29 2c 20 61 _array.=.array(array(1,2,3,4),.a
0580 72 72 61 79 28 31 20 3d 3e 20 22 6f 6e 65 22 2c 20 32 20 3d 3e 20 22 74 77 6f 22 29 2c 20 22 50 rray(1.=>."one",.2.=>."two"),."P
05a0 48 50 22 2c 20 35 30 29 3b 0a 76 61 72 5f 64 75 6d 70 28 69 6d 70 6c 6f 64 65 28 22 54 45 53 54 HP",.50);.var_dump(implode("TEST
05c0 22 2c 20 24 73 75 62 5f 61 72 72 61 79 29 29 3b 0a 74 72 79 20 7b 0a 20 20 20 76 61 72 5f 64 75 ",.$sub_array));.try.{....var_du
05e0 6d 70 28 69 6d 70 6c 6f 64 65 28 61 72 72 61 79 28 31 2c 20 32 2c 20 33 2c 20 34 29 2c 20 24 73 mp(implode(array(1,.2,.3,.4),.$s
0600 75 62 5f 61 72 72 61 79 29 29 3b 0a 7d 20 63 61 74 63 68 20 28 54 79 70 65 45 72 72 6f 72 20 24 ub_array));.}.catch.(TypeError.$
0620 65 78 63 65 70 74 69 6f 6e 29 20 7b 0a 20 20 65 63 68 6f 20 24 65 78 63 65 70 74 69 6f 6e 2d 3e exception).{...echo.$exception->
0640 67 65 74 4d 65 73 73 61 67 65 28 29 20 2e 20 22 5c 6e 22 3b 0a 7d 0a 74 72 79 20 7b 0a 20 20 20 getMessage()..."\n";.}.try.{....
0660 76 61 72 5f 64 75 6d 70 28 20 69 6d 70 6c 6f 64 65 28 32 2c 20 24 73 75 62 5f 61 72 72 61 79 29 var_dump(.implode(2,.$sub_array)
0680 20 29 3b 0a 7d 20 63 61 74 63 68 20 28 54 79 70 65 45 72 72 6f 72 20 24 65 78 63 65 70 74 69 6f .);.}.catch.(TypeError.$exceptio
06a0 6e 29 20 7b 0a 20 20 65 63 68 6f 20 24 65 78 63 65 70 74 69 6f 6e 2d 3e 67 65 74 4d 65 73 73 61 n).{...echo.$exception->getMessa
06c0 67 65 28 29 20 2e 20 22 5c 6e 22 3b 0a 7d 0a 0a 65 63 68 6f 20 22 5c 6e 2a 2a 2a 20 54 65 73 74 ge()..."\n";.}..echo."\n***.Test
06e0 69 6e 67 20 69 6d 70 6c 6f 64 65 28 29 20 6f 6e 20 6f 62 6a 65 63 74 73 20 2a 2a 2a 5c 6e 22 3b ing.implode().on.objects.***\n";
0700 0a 2f 2a 20 63 68 65 63 6b 69 6e 67 20 6f 6e 20 6f 62 6a 65 63 74 73 20 2a 2f 0a 63 6c 61 73 73 ./*.checking.on.objects.*/.class
0720 20 66 6f 6f 0a 7b 0a 20 20 66 75 6e 63 74 69 6f 6e 20 5f 5f 74 6f 53 74 72 69 6e 67 28 29 20 7b .foo.{...function.__toString().{
0740 0a 20 20 20 20 72 65 74 75 72 6e 20 22 4f 62 6a 65 63 74 22 3b 0a 20 20 7d 0a 7d 0a 0a 24 6f 62 .....return."Object";...}.}..$ob
0760 6a 20 3d 20 6e 65 77 20 66 6f 6f 28 29 3b 20 2f 2f 63 72 65 61 74 69 6e 67 20 6e 65 77 20 6f 62 j.=.new.foo();.//creating.new.ob
0780 6a 65 63 74 0a 24 61 72 72 20 3d 20 61 72 72 61 79 28 29 3b 0a 24 61 72 72 5b 30 5d 20 3d 20 26 ject.$arr.=.array();.$arr[0].=.&
07a0 24 6f 62 6a 3b 0a 24 61 72 72 5b 31 5d 20 3d 20 26 24 6f 62 6a 3b 0a 76 61 72 5f 64 75 6d 70 28 $obj;.$arr[1].=.&$obj;.var_dump(
07c0 20 69 6d 70 6c 6f 64 65 28 22 2c 22 2c 20 24 61 72 72 29 20 29 3b 0a 76 61 72 5f 64 75 6d 70 28 .implode(",",.$arr).);.var_dump(
07e0 24 61 72 72 29 3b 0a 0a 2f 2a 20 43 68 65 63 6b 69 6e 67 20 6f 6e 20 72 65 73 6f 75 72 63 65 20 $arr);../*.Checking.on.resource.
0800 74 79 70 65 73 20 2a 2f 0a 65 63 68 6f 20 22 5c 6e 2a 2a 2a 20 54 65 73 74 69 6e 67 20 65 6e 64 types.*/.echo."\n***.Testing.end
0820 28 29 20 6f 6e 20 72 65 73 6f 75 72 63 65 20 74 79 70 65 20 2a 2a 2a 5c 6e 22 3b 0a 2f 2a 20 66 ().on.resource.type.***\n";./*.f
0840 69 6c 65 20 74 79 70 65 20 72 65 73 6f 75 72 63 65 20 2a 2f 0a 24 66 69 6c 65 5f 68 61 6e 64 6c ile.type.resource.*/.$file_handl
0860 65 20 3d 20 66 6f 70 65 6e 28 5f 5f 46 49 4c 45 5f 5f 2c 20 22 72 22 29 3b 0a 0a 2f 2a 20 64 69 e.=.fopen(__FILE__,."r");../*.di
0880 72 65 63 74 6f 72 79 20 74 79 70 65 20 72 65 73 6f 75 72 63 65 20 2a 2f 0a 24 64 69 72 5f 68 61 rectory.type.resource.*/.$dir_ha
08a0 6e 64 6c 65 20 3d 20 6f 70 65 6e 64 69 72 28 20 5f 5f 44 49 52 5f 5f 20 29 3b 0a 0a 2f 2a 20 73 ndle.=.opendir(.__DIR__.);../*.s
08c0 74 6f 72 65 20 72 65 73 6f 75 72 63 65 73 20 69 6e 20 61 72 72 61 79 20 66 6f 72 20 63 6f 6d 70 tore.resources.in.array.for.comp
08e0 61 72 69 73 6f 6e 20 2a 2f 0a 24 72 65 73 6f 75 72 63 65 73 20 3d 20 61 72 72 61 79 28 24 66 69 arison.*/.$resources.=.array($fi
0900 6c 65 5f 68 61 6e 64 6c 65 2c 20 24 64 69 72 5f 68 61 6e 64 6c 65 29 3b 0a 0a 76 61 72 5f 64 75 le_handle,.$dir_handle);..var_du
0920 6d 70 28 20 69 6d 70 6c 6f 64 65 28 22 3a 3a 22 2c 20 24 72 65 73 6f 75 72 63 65 73 29 20 29 3b mp(.implode("::",.$resources).);
0940 0a 0a 65 63 68 6f 20 22 5c 6e 2a 2a 2a 20 54 65 73 74 69 6e 67 20 65 72 72 6f 72 20 63 6f 6e 64 ..echo."\n***.Testing.error.cond
0960 69 74 69 6f 6e 73 20 2a 2a 2a 5c 6e 22 3b 0a 0a 2f 2a 20 6f 6e 6c 79 20 67 6c 75 65 20 2a 2f 0a itions.***\n";../*.only.glue.*/.
0980 74 72 79 20 7b 0a 20 20 20 20 76 61 72 5f 64 75 6d 70 28 20 69 6d 70 6c 6f 64 65 28 22 67 6c 75 try.{.....var_dump(.implode("glu
09a0 65 22 29 20 29 3b 0a 7d 20 63 61 74 63 68 20 28 54 79 70 65 45 72 72 6f 72 20 24 65 29 20 7b 0a e").);.}.catch.(TypeError.$e).{.
09c0 20 20 20 20 65 63 68 6f 20 24 65 2d 3e 67 65 74 4d 65 73 73 61 67 65 28 29 2c 20 22 5c 6e 22 3b ....echo.$e->getMessage(),."\n";
09e0 0a 7d 0a 0a 2f 2a 20 69 6e 74 20 61 73 20 70 69 65 63 65 73 20 2a 2f 0a 74 72 79 20 7b 0a 20 20 .}../*.int.as.pieces.*/.try.{...
0a00 20 20 76 61 72 5f 64 75 6d 70 28 20 69 6d 70 6c 6f 64 65 28 22 67 6c 75 65 22 2c 31 32 33 34 29 ..var_dump(.implode("glue",1234)
0a20 20 29 3b 0a 7d 20 63 61 74 63 68 20 28 54 79 70 65 45 72 72 6f 72 20 24 65 29 20 7b 0a 20 20 20 .);.}.catch.(TypeError.$e).{....
0a40 20 65 63 68 6f 20 24 65 2d 3e 67 65 74 4d 65 73 73 61 67 65 28 29 2c 20 22 5c 6e 22 3b 0a 7d 0a .echo.$e->getMessage(),."\n";.}.
0a60 0a 2f 2a 20 4e 55 4c 4c 20 61 73 20 70 69 65 63 65 73 20 2a 2f 0a 74 72 79 20 7b 0a 20 20 20 20 ./*.NULL.as.pieces.*/.try.{.....
0a80 76 61 72 5f 64 75 6d 70 28 20 69 6d 70 6c 6f 64 65 28 22 67 6c 75 65 22 2c 20 4e 55 4c 4c 29 20 var_dump(.implode("glue",.NULL).
0aa0 29 3b 0a 7d 20 63 61 74 63 68 20 28 54 79 70 65 45 72 72 6f 72 20 24 65 29 20 7b 0a 20 20 20 20 );.}.catch.(TypeError.$e).{.....
0ac0 65 63 68 6f 20 24 65 2d 3e 67 65 74 4d 65 73 73 61 67 65 28 29 2c 20 22 5c 6e 22 3b 0a 7d 0a 0a echo.$e->getMessage(),."\n";.}..
0ae0 2f 2a 20 70 69 65 63 65 73 20 61 73 20 4e 55 4c 4c 20 61 72 72 61 79 20 2a 2f 0a 74 72 79 20 7b /*.pieces.as.NULL.array.*/.try.{
0b00 0a 20 20 20 20 76 61 72 5f 64 75 6d 70 28 20 69 6d 70 6c 6f 64 65 28 22 2c 22 2c 20 61 72 72 61 .....var_dump(.implode(",",.arra
0b20 79 28 4e 55 4c 4c 29 29 20 29 3b 0a 7d 20 63 61 74 63 68 20 28 54 79 70 65 45 72 72 6f 72 20 24 y(NULL)).);.}.catch.(TypeError.$
0b40 65 29 20 7b 0a 20 20 20 20 65 63 68 6f 20 24 65 2d 3e 67 65 74 4d 65 73 73 61 67 65 28 29 2c 20 e).{.....echo.$e->getMessage(),.
0b60 22 5c 6e 22 3b 0a 7d 0a 0a 2f 2a 20 69 6e 74 65 67 65 72 20 61 73 20 67 6c 75 65 20 2a 2f 0a 74 "\n";.}../*.integer.as.glue.*/.t
0b80 72 79 20 7b 0a 20 20 20 20 76 61 72 5f 64 75 6d 70 28 20 69 6d 70 6c 6f 64 65 28 31 32 2c 20 22 ry.{.....var_dump(.implode(12,."
0ba0 70 69 65 63 65 73 22 29 20 29 3b 0a 7d 20 63 61 74 63 68 20 28 54 79 70 65 45 72 72 6f 72 20 24 pieces").);.}.catch.(TypeError.$
0bc0 65 29 20 7b 0a 20 20 20 20 65 63 68 6f 20 24 65 2d 3e 67 65 74 4d 65 73 73 61 67 65 28 29 2c 20 e).{.....echo.$e->getMessage(),.
0be0 22 5c 6e 22 3b 0a 7d 0a 0a 2f 2a 20 4e 55 4c 4c 20 61 73 20 67 6c 75 65 20 2a 2f 0a 74 72 79 20 "\n";.}../*.NULL.as.glue.*/.try.
0c00 7b 0a 20 20 20 20 76 61 72 5f 64 75 6d 70 28 20 69 6d 70 6c 6f 64 65 28 4e 55 4c 4c 2c 20 22 61 {.....var_dump(.implode(NULL,."a
0c20 62 63 64 22 29 20 29 3b 0a 7d 20 63 61 74 63 68 20 28 54 79 70 65 45 72 72 6f 72 20 24 65 29 20 bcd").);.}.catch.(TypeError.$e).
0c40 7b 0a 20 20 20 20 65 63 68 6f 20 24 65 2d 3e 67 65 74 4d 65 73 73 61 67 65 28 29 2c 20 22 5c 6e {.....echo.$e->getMessage(),."\n
0c60 22 3b 0a 7d 0a 0a 2f 2a 20 63 6c 6f 73 69 6e 67 20 72 65 73 6f 75 72 63 65 20 68 61 6e 64 6c 65 ";.}../*.closing.resource.handle
0c80 73 20 2a 2f 0a 66 63 6c 6f 73 65 28 24 66 69 6c 65 5f 68 61 6e 64 6c 65 29 3b 0a 63 6c 6f 73 65 s.*/.fclose($file_handle);.close
0ca0 64 69 72 28 24 64 69 72 5f 68 61 6e 64 6c 65 29 3b 0a 0a 65 63 68 6f 20 22 44 6f 6e 65 5c 6e 22 dir($dir_handle);..echo."Done\n"
0cc0 3b 0a 3f 3e 0a 2d 2d 45 58 50 45 43 54 46 2d 2d 0a 2a 2a 2a 20 54 65 73 74 69 6e 67 20 69 6d 70 ;.?>.--EXPECTF--.***.Testing.imp
0ce0 6c 6f 64 65 28 29 20 66 6f 72 20 62 61 73 69 63 20 6f 70 65 72 61 74 69 6f 6e 73 20 2a 2a 2a 0a lode().for.basic.operations.***.
0d00 73 74 72 69 6e 67 28 34 29 20 22 31 2c 20 32 22 0a 61 72 72 61 79 28 32 29 20 7b 0a 20 20 5b 30 string(4)."1,.2".array(2).{...[0
0d20 5d 3d 3e 0a 20 20 69 6e 74 28 31 29 0a 20 20 5b 31 5d 3d 3e 0a 20 20 69 6e 74 28 32 29 0a 7d 0a ]=>...int(1)...[1]=>...int(2).}.
0d40 73 74 72 69 6e 67 28 38 29 20 22 31 2e 31 2c 20 32 2e 32 22 0a 61 72 72 61 79 28 32 29 20 7b 0a string(8)."1.1,.2.2".array(2).{.
0d60 20 20 5b 30 5d 3d 3e 0a 20 20 66 6c 6f 61 74 28 31 2e 31 29 0a 20 20 5b 31 5d 3d 3e 0a 20 20 66 ..[0]=>...float(1.1)...[1]=>...f
0d80 6c 6f 61 74 28 32 2e 32 29 0a 7d 0a 0a 57 61 72 6e 69 6e 67 3a 20 41 72 72 61 79 20 74 6f 20 73 loat(2.2).}..Warning:.Array.to.s
0da0 74 72 69 6e 67 20 63 6f 6e 76 65 72 73 69 6f 6e 20 69 6e 20 25 73 20 6f 6e 20 6c 69 6e 65 20 25 tring.conversion.in.%s.on.line.%
0dc0 64 0a 0a 57 61 72 6e 69 6e 67 3a 20 41 72 72 61 79 20 74 6f 20 73 74 72 69 6e 67 20 63 6f 6e 76 d..Warning:.Array.to.string.conv
0de0 65 72 73 69 6f 6e 20 69 6e 20 25 73 20 6f 6e 20 6c 69 6e 65 20 25 64 0a 73 74 72 69 6e 67 28 31 ersion.in.%s.on.line.%d.string(1
0e00 32 29 20 22 41 72 72 61 79 2c 20 41 72 72 61 79 22 0a 61 72 72 61 79 28 32 29 20 7b 0a 20 20 5b 2)."Array,.Array".array(2).{...[
0e20 30 5d 3d 3e 0a 20 20 61 72 72 61 79 28 31 29 20 7b 0a 20 20 20 20 5b 30 5d 3d 3e 0a 20 20 20 20 0]=>...array(1).{.....[0]=>.....
0e40 69 6e 74 28 32 29 0a 20 20 7d 0a 20 20 5b 31 5d 3d 3e 0a 20 20 61 72 72 61 79 28 31 29 20 7b 0a int(2)...}...[1]=>...array(1).{.
0e60 20 20 20 20 5b 30 5d 3d 3e 0a 20 20 20 20 69 6e 74 28 31 29 0a 20 20 7d 0a 7d 0a 73 74 72 69 6e ....[0]=>.....int(1)...}.}.strin
0e80 67 28 33 29 20 22 2c 20 31 22 0a 61 72 72 61 79 28 32 29 20 7b 0a 20 20 5b 30 5d 3d 3e 0a 20 20 g(3).",.1".array(2).{...[0]=>...
0ea0 62 6f 6f 6c 28 66 61 6c 73 65 29 0a 20 20 5b 31 5d 3d 3e 0a 20 20 62 6f 6f 6c 28 74 72 75 65 29 bool(false)...[1]=>...bool(true)
0ec0 0a 7d 0a 73 74 72 69 6e 67 28 30 29 20 22 22 0a 61 72 72 61 79 28 30 29 20 7b 0a 7d 0a 73 74 72 .}.string(0)."".array(0).{.}.str
0ee0 69 6e 67 28 34 32 29 20 22 61 2c 20 61 61 61 61 2c 20 62 2c 20 62 62 62 62 2c 20 63 2c 20 63 63 ing(42)."a,.aaaa,.b,.bbbb,.c,.cc
0f00 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 22 0a 61 72 72 61 79 28 36 29 20 7b 0a ccccccccccccccccccc".array(6).{.
0f20 20 20 5b 30 5d 3d 3e 0a 20 20 73 74 72 69 6e 67 28 31 29 20 22 61 22 0a 20 20 5b 31 5d 3d 3e 0a ..[0]=>...string(1)."a"...[1]=>.
0f40 20 20 73 74 72 69 6e 67 28 34 29 20 22 61 61 61 61 22 0a 20 20 5b 32 5d 3d 3e 0a 20 20 73 74 72 ..string(4)."aaaa"...[2]=>...str
0f60 69 6e 67 28 31 29 20 22 62 22 0a 20 20 5b 33 5d 3d 3e 0a 20 20 73 74 72 69 6e 67 28 34 29 20 22 ing(1)."b"...[3]=>...string(4)."
0f80 62 62 62 62 22 0a 20 20 5b 34 5d 3d 3e 0a 20 20 73 74 72 69 6e 67 28 31 29 20 22 63 22 0a 20 20 bbbb"...[4]=>...string(1)."c"...
0fa0 5b 35 5d 3d 3e 0a 20 20 73 74 72 69 6e 67 28 32 31 29 20 22 63 63 63 63 63 63 63 63 63 63 63 63 [5]=>...string(21)."cccccccccccc
0fc0 63 63 63 63 63 63 63 63 63 22 0a 7d 0a 0a 2a 2a 2a 20 54 65 73 74 69 6e 67 20 69 6d 70 6c 6f 64 ccccccccc".}..***.Testing.implod
0fe0 65 28 29 20 77 69 74 68 20 76 61 72 69 61 74 69 6f 6e 73 20 6f 66 20 67 6c 75 65 20 2a 2a 2a 0a e().with.variations.of.glue.***.
1000 2d 2d 20 49 74 65 72 61 74 69 6f 6e 20 31 20 2d 2d 0a 73 74 72 69 6e 67 28 36 33 29 20 22 32 54 --.Iteration.1.--.string(63)."2T
1020 52 55 45 30 54 52 55 45 2d 36 33 39 54 52 55 45 31 54 52 55 45 50 48 50 54 52 55 45 54 52 55 45 RUE0TRUE-639TRUE1TRUEPHPTRUETRUE
1040 54 52 55 45 54 52 55 45 20 54 52 55 45 73 74 72 69 6e 67 00 77 69 74 68 00 2e 2e 2e 00 22 0a 2d TRUETRUE.TRUEstring.with.....".-
1060 2d 20 49 74 65 72 61 74 69 6f 6e 20 32 20 2d 2d 0a 73 74 72 69 6e 67 28 33 36 29 20 22 32 31 30 -.Iteration.2.--.string(36)."210
1080 31 2d 36 33 39 31 31 31 50 48 50 31 31 31 31 20 31 73 74 72 69 6e 67 00 77 69 74 68 00 2e 2e 2e 1-639111PHP1111.1string.with....
10a0 00 22 0a 2d 2d 20 49 74 65 72 61 74 69 6f 6e 20 33 20 2d 2d 0a 73 74 72 69 6e 67 28 32 37 29 20 .".--.Iteration.3.--.string(27).
10c0 22 32 30 2d 36 33 39 31 50 48 50 20 73 74 72 69 6e 67 00 77 69 74 68 00 2e 2e 2e 00 22 0a 2d 2d "20-6391PHP.string.with.....".--
10e0 20 49 74 65 72 61 74 69 6f 6e 20 34 20 2d 2d 0a 69 6d 70 6c 6f 64 65 28 29 3a 20 41 72 67 75 6d .Iteration.4.--.implode():.Argum
1100 65 6e 74 20 23 31 20 28 24 73 65 70 61 72 61 74 6f 72 29 20 6d 75 73 74 20 62 65 20 6f 66 20 74 ent.#1.($separator).must.be.of.t
1120 79 70 65 20 73 74 72 69 6e 67 2c 20 61 72 72 61 79 20 67 69 76 65 6e 0a 2d 2d 20 49 74 65 72 61 ype.string,.array.given.--.Itera
1140 74 69 6f 6e 20 35 20 2d 2d 0a 73 74 72 69 6e 67 28 32 37 29 20 22 32 30 2d 36 33 39 31 50 48 50 tion.5.--.string(27)."20-6391PHP
1160 20 73 74 72 69 6e 67 00 77 69 74 68 00 2e 2e 2e 00 22 0a 2d 2d 20 49 74 65 72 61 74 69 6f 6e 20 .string.with.....".--.Iteration.
1180 36 20 2d 2d 0a 73 74 72 69 6e 67 28 33 36 29 20 22 32 20 30 20 2d 36 33 39 20 31 20 50 48 50 20 6.--.string(36)."2.0.-639.1.PHP.
11a0 20 20 20 20 20 73 74 72 69 6e 67 00 77 69 74 68 00 2e 2e 2e 00 22 0a 2d 2d 20 49 74 65 72 61 74 .....string.with.....".--.Iterat
11c0 69 6f 6e 20 37 20 2d 2d 0a 73 74 72 69 6e 67 28 31 35 33 29 20 22 32 73 74 72 69 6e 67 00 62 65 ion.7.--.string(153)."2string.be
11e0 74 77 65 65 6e 30 73 74 72 69 6e 67 00 62 65 74 77 65 65 6e 2d 36 33 39 73 74 72 69 6e 67 00 62 tween0string.between-639string.b
1200 65 74 77 65 65 6e 31 73 74 72 69 6e 67 00 62 65 74 77 65 65 6e 50 48 50 73 74 72 69 6e 67 00 62 etween1string.betweenPHPstring.b
1220 65 74 77 65 65 6e 73 74 72 69 6e 67 00 62 65 74 77 65 65 6e 73 74 72 69 6e 67 00 62 65 74 77 65 etweenstring.betweenstring.betwe
1240 65 6e 73 74 72 69 6e 67 00 62 65 74 77 65 65 6e 20 73 74 72 69 6e 67 00 62 65 74 77 65 65 6e 73 enstring.between.string.betweens
1260 74 72 69 6e 67 00 77 69 74 68 00 2e 2e 2e 00 22 0a 2d 2d 20 49 74 65 72 61 74 69 6f 6e 20 38 20 tring.with.....".--.Iteration.8.
1280 2d 2d 0a 73 74 72 69 6e 67 28 32 37 29 20 22 32 30 2d 36 33 39 31 50 48 50 20 73 74 72 69 6e 67 --.string(27)."20-6391PHP.string
12a0 00 77 69 74 68 00 2e 2e 2e 00 22 0a 2d 2d 20 49 74 65 72 61 74 69 6f 6e 20 39 20 2d 2d 0a 73 74 .with.....".--.Iteration.9.--.st
12c0 72 69 6e 67 28 33 36 29 20 22 32 30 30 30 2d 36 33 39 30 31 30 50 48 50 30 30 30 30 20 30 73 74 ring(36)."2000-639010PHP0000.0st
12e0 72 69 6e 67 00 77 69 74 68 00 2e 2e 2e 00 22 0a 2d 2d 20 49 74 65 72 61 74 69 6f 6e 20 31 30 20 ring.with.....".--.Iteration.10.
1300 2d 2d 0a 73 74 72 69 6e 67 28 34 35 29 20 22 32 5c 30 30 5c 30 2d 36 33 39 5c 30 31 5c 30 50 48 --.string(45)."2\00\0-639\01\0PH
1320 50 5c 30 5c 30 5c 30 5c 30 20 5c 30 73 74 72 69 6e 67 00 77 69 74 68 00 2e 2e 2e 00 22 0a 0a 2a P\0\0\0\0.\0string.with....."..*
1340 2a 2a 20 54 65 73 74 69 6e 67 20 69 6d 70 6c 6f 64 65 28 29 20 6f 6e 20 65 6d 70 74 79 20 73 74 **.Testing.implode().on.empty.st
1360 72 69 6e 67 20 2a 2a 2a 0a 69 6d 70 6c 6f 64 65 28 29 3a 20 41 72 67 75 6d 65 6e 74 20 23 31 20 ring.***.implode():.Argument.#1.
1380 28 24 70 69 65 63 65 73 29 20 6d 75 73 74 20 62 65 20 6f 66 20 74 79 70 65 20 61 72 72 61 79 2c ($pieces).must.be.of.type.array,
13a0 20 73 74 72 69 6e 67 20 67 69 76 65 6e 0a 0a 2a 2a 2a 20 54 65 73 74 69 6e 67 20 69 6d 70 6c 6f .string.given..***.Testing.implo
13c0 64 65 28 29 20 6f 6e 20 73 75 62 2d 61 72 72 61 79 73 20 2a 2a 2a 0a 0a 57 61 72 6e 69 6e 67 3a de().on.sub-arrays.***..Warning:
13e0 20 41 72 72 61 79 20 74 6f 20 73 74 72 69 6e 67 20 63 6f 6e 76 65 72 73 69 6f 6e 20 69 6e 20 25 .Array.to.string.conversion.in.%
1400 73 20 6f 6e 20 6c 69 6e 65 20 25 64 0a 0a 57 61 72 6e 69 6e 67 3a 20 41 72 72 61 79 20 74 6f 20 s.on.line.%d..Warning:.Array.to.
1420 73 74 72 69 6e 67 20 63 6f 6e 76 65 72 73 69 6f 6e 20 69 6e 20 25 73 20 6f 6e 20 6c 69 6e 65 20 string.conversion.in.%s.on.line.
1440 25 64 0a 73 74 72 69 6e 67 28 32 37 29 20 22 41 72 72 61 79 54 45 53 54 41 72 72 61 79 54 45 53 %d.string(27)."ArrayTESTArrayTES
1460 54 50 48 50 54 45 53 54 35 30 22 0a 69 6d 70 6c 6f 64 65 28 29 3a 20 41 72 67 75 6d 65 6e 74 20 TPHPTEST50".implode():.Argument.
1480 23 31 20 28 24 73 65 70 61 72 61 74 6f 72 29 20 6d 75 73 74 20 62 65 20 6f 66 20 74 79 70 65 20 #1.($separator).must.be.of.type.
14a0 73 74 72 69 6e 67 2c 20 61 72 72 61 79 20 67 69 76 65 6e 0a 0a 57 61 72 6e 69 6e 67 3a 20 41 72 string,.array.given..Warning:.Ar
14c0 72 61 79 20 74 6f 20 73 74 72 69 6e 67 20 63 6f 6e 76 65 72 73 69 6f 6e 20 69 6e 20 25 73 0a 0a ray.to.string.conversion.in.%s..
14e0 57 61 72 6e 69 6e 67 3a 20 41 72 72 61 79 20 74 6f 20 73 74 72 69 6e 67 20 63 6f 6e 76 65 72 73 Warning:.Array.to.string.convers
1500 69 6f 6e 20 69 6e 20 25 73 0a 73 74 72 69 6e 67 28 31 38 29 20 22 41 72 72 61 79 32 41 72 72 61 ion.in.%s.string(18)."Array2Arra
1520 79 32 50 48 50 32 35 30 22 0a 0a 2a 2a 2a 20 54 65 73 74 69 6e 67 20 69 6d 70 6c 6f 64 65 28 29 y2PHP250"..***.Testing.implode()
1540 20 6f 6e 20 6f 62 6a 65 63 74 73 20 2a 2a 2a 0a 73 74 72 69 6e 67 28 31 33 29 20 22 4f 62 6a 65 .on.objects.***.string(13)."Obje
1560 63 74 2c 4f 62 6a 65 63 74 22 0a 61 72 72 61 79 28 32 29 20 7b 0a 20 20 5b 30 5d 3d 3e 0a 20 20 ct,Object".array(2).{...[0]=>...
1580 26 6f 62 6a 65 63 74 28 66 6f 6f 29 23 25 64 20 28 30 29 20 7b 0a 20 20 7d 0a 20 20 5b 31 5d 3d &object(foo)#%d.(0).{...}...[1]=
15a0 3e 0a 20 20 26 6f 62 6a 65 63 74 28 66 6f 6f 29 23 25 64 20 28 30 29 20 7b 0a 20 20 7d 0a 7d 0a >...&object(foo)#%d.(0).{...}.}.
15c0 0a 2a 2a 2a 20 54 65 73 74 69 6e 67 20 65 6e 64 28 29 20 6f 6e 20 72 65 73 6f 75 72 63 65 20 74 .***.Testing.end().on.resource.t
15e0 79 70 65 20 2a 2a 2a 0a 73 74 72 69 6e 67 28 25 64 29 20 22 52 65 73 6f 75 72 63 65 20 69 64 20 ype.***.string(%d)."Resource.id.
1600 23 25 64 3a 3a 52 65 73 6f 75 72 63 65 20 69 64 20 23 25 64 22 0a 0a 2a 2a 2a 20 54 65 73 74 69 #%d::Resource.id.#%d"..***.Testi
1620 6e 67 20 65 72 72 6f 72 20 63 6f 6e 64 69 74 69 6f 6e 73 20 2a 2a 2a 0a 69 6d 70 6c 6f 64 65 28 ng.error.conditions.***.implode(
1640 29 3a 20 41 72 67 75 6d 65 6e 74 20 23 31 20 28 24 70 69 65 63 65 73 29 20 6d 75 73 74 20 62 65 ):.Argument.#1.($pieces).must.be
1660 20 6f 66 20 74 79 70 65 20 61 72 72 61 79 2c 20 73 74 72 69 6e 67 20 67 69 76 65 6e 0a 69 6d 70 .of.type.array,.string.given.imp
1680 6c 6f 64 65 28 29 3a 20 41 72 67 75 6d 65 6e 74 20 23 32 20 28 24 61 72 72 61 79 29 20 6d 75 73 lode():.Argument.#2.($array).mus
16a0 74 20 62 65 20 6f 66 20 74 79 70 65 20 3f 61 72 72 61 79 2c 20 69 6e 74 20 67 69 76 65 6e 0a 69 t.be.of.type.?array,.int.given.i
16c0 6d 70 6c 6f 64 65 28 29 3a 20 41 72 67 75 6d 65 6e 74 20 23 31 20 28 24 70 69 65 63 65 73 29 20 mplode():.Argument.#1.($pieces).
16e0 6d 75 73 74 20 62 65 20 6f 66 20 74 79 70 65 20 61 72 72 61 79 2c 20 73 74 72 69 6e 67 20 67 69 must.be.of.type.array,.string.gi
1700 76 65 6e 0a 73 74 72 69 6e 67 28 30 29 20 22 22 0a 69 6d 70 6c 6f 64 65 28 29 3a 20 41 72 67 75 ven.string(0)."".implode():.Argu
1720 6d 65 6e 74 20 23 32 20 28 24 61 72 72 61 79 29 20 6d 75 73 74 20 62 65 20 6f 66 20 74 79 70 65 ment.#2.($array).must.be.of.type
1740 20 3f 61 72 72 61 79 2c 20 73 74 72 69 6e 67 20 67 69 76 65 6e 0a 69 6d 70 6c 6f 64 65 28 29 3a .?array,.string.given.implode():
1760 20 41 72 67 75 6d 65 6e 74 20 23 32 20 28 24 61 72 72 61 79 29 20 6d 75 73 74 20 62 65 20 6f 66 .Argument.#2.($array).must.be.of
1780 20 74 79 70 65 20 3f 61 72 72 61 79 2c 20 73 74 72 69 6e 67 20 67 69 76 65 6e 0a 44 6f 6e 65 0a .type.?array,.string.given.Done.