xref: /PHP-5.4/Zend/tests/concat_001.phpt (revision d81ea16e)
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--
53
54Notice: Array to string conversion in %sconcat_001.php on line %d
55string(24) "Arraythis is test object"
56
57Notice: Array to string conversion in %sconcat_001.php on line %d
58string(16) "Arraysome string"
59
60Notice: Array to string conversion in %sconcat_001.php on line %d
61string(8) "Array222"
62
63Notice: Array to string conversion in %sconcat_001.php on line %d
64string(13) "Array2323.444"
65
66Notice: Array to string conversion in %sconcat_001.php on line %d
67
68Notice: Array to string conversion in %sconcat_001.php on line %d
69string(10) "ArrayArray"
70
71Notice: Array to string conversion in %sconcat_001.php on line %d
72string(24) "this is test objectArray"
73string(30) "this is test objectsome string"
74string(22) "this is test object222"
75string(27) "this is test object2323.444"
76string(38) "this is test objectthis is test object"
77string(30) "some stringthis is test object"
78
79Notice: Array to string conversion in %sconcat_001.php on line %d
80string(16) "some stringArray"
81string(14) "some string222"
82string(19) "some string2323.444"
83string(22) "some stringsome string"
84
85Notice: Array to string conversion in %sconcat_001.php on line %d
86string(8) "222Array"
87string(22) "222this is test object"
88string(14) "222some string"
89string(11) "2222323.444"
90string(6) "222222"
91
92Notice: Array to string conversion in %sconcat_001.php on line %d
93string(13) "2323.444Array"
94string(27) "2323.444this is test object"
95string(19) "2323.444some string"
96string(11) "2323.444222"
97string(16) "2323.4442323.444"
98Done
99