Skip to content

Commit 5ba604a

Browse files
committed
apply changes from code review
1 parent 8c0c892 commit 5ba604a

3 files changed

Lines changed: 9 additions & 18 deletions

File tree

NEWS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ PHP NEWS
121121
. Fixed bug GH-19926 (reset internal pointer earlier while splicing array
122122
while COW violation flag is still set). (alexandre-daubois)
123123
. Added form feed (\f) in the default trimmed characters of trim(), rtrim()
124-
and ltrim(). (Weilin Du, LamentXU)
124+
and ltrim(). (Weilin Du)
125125
. Invalid mode values now throw in array_filter() instead of being silently
126126
defaulted to 0. (Jorg Sowa)
127127
. Fixed bug GH-21058 (error_log() crashes with message_type 3 and

ext/standard/tests/strings/trim.phpt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ var_dump("ABC" === trim("ABC\x50\xC1\x60\x90","\x50..\xC1"));
1818
var_dump("ABC\x50\xC1" === trim("ABC\x50\xC1\x60\x90","\x51..\xC0"));
1919
var_dump("ABC\x50" === trim("ABC\x50\xC1\x60\x90","\x51..\xC1"));
2020
var_dump("ABC" === trim("ABC\x50\xC1\x60\x90","\x50..\xC1"));
21+
var_dump('ABC' === trim('\fABC'));
22+
var_dump('ABC' === ltrim('\fABC'));
23+
var_dump('ABC' === rtrim('\fABC'));
2124

2225
?>
2326
--EXPECT--
@@ -36,3 +39,6 @@ bool(true)
3639
bool(true)
3740
bool(true)
3841
bool(true)
42+
bool(true)
43+
bool(true)
44+
bool(true)

tests/classes/tostring_001.phpt

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,6 @@ class test3
2424
return [];
2525
}
2626
}
27-
28-
class test4
29-
{
30-
function __toString()
31-
{
32-
echo __METHOD__ . "()\n";
33-
return "Converted\f";
34-
}
35-
}
36-
3727
echo "====test1====\n";
3828
$o = new test1;
3929
print_r($o);
@@ -87,9 +77,7 @@ try {
8777
} catch (Error $e) {
8878
echo $e->getMessage(), "\n";
8979
}
90-
echo "====test11====\n";
91-
$o = new test4();
92-
var_dump(trim($o));
80+
9381
?>
9482
====DONE====
9583
--EXPECT--
@@ -144,7 +132,4 @@ object(test3)#2 (0) {
144132
}
145133
test3::__toString()
146134
test3::__toString(): Return value must be of type string, array returned
147-
====test11====
148-
test4::__toString()
149-
string(9) "Converted"
150-
====DONE====
135+
====DONE====

0 commit comments

Comments
 (0)