xref: /PHP-5.6/Zend/tests/add_006.phpt (revision 56a27267)
1--TEST--
2adding numbers to strings
3--INI--
4precision=14
5--FILE--
6<?php
7
8$i = 75636;
9$s1 = "this is a string";
10$s2 = "876222numeric";
11$s3 = "48474874";
12$s4 = "25.68";
13
14$c = $i + $s1;
15var_dump($c);
16
17$c = $i + $s2;
18var_dump($c);
19
20$c = $i + $s3;
21var_dump($c);
22
23$c = $i + $s4;
24var_dump($c);
25
26$c = $s1 + $i;
27var_dump($c);
28
29$c = $s2 + $i;
30var_dump($c);
31
32$c = $s3 + $i;
33var_dump($c);
34
35$c = $s4 + $i;
36var_dump($c);
37
38echo "Done\n";
39?>
40--EXPECTF--
41int(75636)
42int(951858)
43int(48550510)
44float(75661.68)
45int(75636)
46int(951858)
47int(48550510)
48float(75661.68)
49Done
50