mirror of
https://github.com/php/php-src.git
synced 2024-12-14 12:26:19 +08:00
d679f02295
This patch adds missing newlines, trims multiple redundant final newlines into a single one, and trims redundant leading newlines in all *.phpt sections. According to POSIX, a line is a sequence of zero or more non-' <newline>' characters plus a terminating '<newline>' character. [1] Files should normally have at least one final newline character. C89 [2] and later standards [3] mention a final newline: "A source file that is not empty shall end in a new-line character, which shall not be immediately preceded by a backslash character." Although it is not mandatory for all files to have a final newline fixed, a more consistent and homogeneous approach brings less of commit differences issues and a better development experience in certain text editors and IDEs. [1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206 [2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2 [3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
98 lines
2.1 KiB
PHP
98 lines
2.1 KiB
PHP
--TEST--
|
|
concat different types
|
|
--INI--
|
|
precision=14
|
|
--FILE--
|
|
<?php
|
|
|
|
class test {
|
|
function __toString() {
|
|
return "this is test object";
|
|
}
|
|
}
|
|
|
|
$a = array(1,2,3);
|
|
$o = new test;
|
|
$s = "some string";
|
|
$i = 222;
|
|
$d = 2323.444;
|
|
|
|
var_dump($a.$o);
|
|
var_dump($a.$s);
|
|
var_dump($a.$i);
|
|
var_dump($a.$d);
|
|
var_dump($a.$a);
|
|
|
|
var_dump($o.$a);
|
|
var_dump($o.$s);
|
|
var_dump($o.$i);
|
|
var_dump($o.$d);
|
|
var_dump($o.$o);
|
|
|
|
var_dump($s.$o);
|
|
var_dump($s.$a);
|
|
var_dump($s.$i);
|
|
var_dump($s.$d);
|
|
var_dump($s.$s);
|
|
|
|
var_dump($i.$a);
|
|
var_dump($i.$o);
|
|
var_dump($i.$s);
|
|
var_dump($i.$d);
|
|
var_dump($i.$i);
|
|
|
|
var_dump($d.$a);
|
|
var_dump($d.$o);
|
|
var_dump($d.$s);
|
|
var_dump($d.$i);
|
|
var_dump($d.$d);
|
|
|
|
echo "Done\n";
|
|
?>
|
|
--EXPECTF--
|
|
Notice: Array to string conversion in %sconcat_001.php on line %d
|
|
string(24) "Arraythis is test object"
|
|
|
|
Notice: Array to string conversion in %sconcat_001.php on line %d
|
|
string(16) "Arraysome string"
|
|
|
|
Notice: Array to string conversion in %sconcat_001.php on line %d
|
|
string(8) "Array222"
|
|
|
|
Notice: Array to string conversion in %sconcat_001.php on line %d
|
|
string(13) "Array2323.444"
|
|
|
|
Notice: Array to string conversion in %sconcat_001.php on line %d
|
|
|
|
Notice: Array to string conversion in %sconcat_001.php on line %d
|
|
string(10) "ArrayArray"
|
|
|
|
Notice: Array to string conversion in %sconcat_001.php on line %d
|
|
string(24) "this is test objectArray"
|
|
string(30) "this is test objectsome string"
|
|
string(22) "this is test object222"
|
|
string(27) "this is test object2323.444"
|
|
string(38) "this is test objectthis is test object"
|
|
string(30) "some stringthis is test object"
|
|
|
|
Notice: Array to string conversion in %sconcat_001.php on line %d
|
|
string(16) "some stringArray"
|
|
string(14) "some string222"
|
|
string(19) "some string2323.444"
|
|
string(22) "some stringsome string"
|
|
|
|
Notice: Array to string conversion in %sconcat_001.php on line %d
|
|
string(8) "222Array"
|
|
string(22) "222this is test object"
|
|
string(14) "222some string"
|
|
string(11) "2222323.444"
|
|
string(6) "222222"
|
|
|
|
Notice: Array to string conversion in %sconcat_001.php on line %d
|
|
string(13) "2323.444Array"
|
|
string(27) "2323.444this is test object"
|
|
string(19) "2323.444some string"
|
|
string(11) "2323.444222"
|
|
string(16) "2323.4442323.444"
|
|
Done
|