xref: /PHP-5.3/Zend/tests/concat_001.phpt (revision d10755c0)
1--TEST--
2concat different types
3--INI--
4precision=14
5--FILE--
6<?php
7
8class test {
9	function __toString() {
10		return "this is test object";
11	}
12}
13
14$a = array(1,2,3);
15$o = new test;
16$s = "some string";
17$i = 222;
18$d = 2323.444;
19
20var_dump($a.$o);
21var_dump($a.$s);
22var_dump($a.$i);
23var_dump($a.$d);
24var_dump($a.$a);
25
26var_dump($o.$a);
27var_dump($o.$s);
28var_dump($o.$i);
29var_dump($o.$d);
30var_dump($o.$o);
31
32var_dump($s.$o);
33var_dump($s.$a);
34var_dump($s.$i);
35var_dump($s.$d);
36var_dump($s.$s);
37
38var_dump($i.$a);
39var_dump($i.$o);
40var_dump($i.$s);
41var_dump($i.$d);
42var_dump($i.$i);
43
44var_dump($d.$a);
45var_dump($d.$o);
46var_dump($d.$s);
47var_dump($d.$i);
48var_dump($d.$d);
49
50echo "Done\n";
51?>
52--EXPECTF--
53string(24) "Arraythis is test object"
54string(16) "Arraysome string"
55string(8) "Array222"
56string(13) "Array2323.444"
57string(10) "ArrayArray"
58string(24) "this is test objectArray"
59string(30) "this is test objectsome string"
60string(22) "this is test object222"
61string(27) "this is test object2323.444"
62string(38) "this is test objectthis is test object"
63string(30) "some stringthis is test object"
64string(16) "some stringArray"
65string(14) "some string222"
66string(19) "some string2323.444"
67string(22) "some stringsome string"
68string(8) "222Array"
69string(22) "222this is test object"
70string(14) "222some string"
71string(11) "2222323.444"
72string(6) "222222"
73string(13) "2323.444Array"
74string(27) "2323.444this is test object"
75string(19) "2323.444some string"
76string(11) "2323.444222"
77string(16) "2323.4442323.444"
78Done
79