Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions ext/mbstring/tests/bug43840.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ foreach($offsets as $i) {
try {
var_dump( mb_strpos($string_mb, $needle, $i, 'UTF-8') );
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
echo"--ASCII String:--\n";
try {
var_dump(mb_strpos('This is na English ta', 'a', $i));
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
}
?>
Expand All @@ -46,18 +46,18 @@ bool(false)

-- Offset is 22 --
--Multibyte String:--
mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
ValueError: mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
--ASCII String:--
mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
ValueError: mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)

-- Offset is 53 --
--Multibyte String:--
mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
ValueError: mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
--ASCII String:--
mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
ValueError: mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)

-- Offset is 54 --
--Multibyte String:--
mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
ValueError: mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
--ASCII String:--
mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
ValueError: mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
18 changes: 9 additions & 9 deletions ext/mbstring/tests/bug43841.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -19,41 +19,41 @@ foreach ($offsets as $i) {
try {
var_dump( mb_strrpos($string_mb, $needle, $i, 'UTF-8') );
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
echo "ASCII String:\n";
echo "mb_strrpos:\n";
try {
var_dump(mb_strrpos('This is na English ta', 'a', $i));
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
echo "strrpos:\n";
try {
var_dump(strrpos('This is na English ta', 'a', $i));
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
}
?>
--EXPECT--
-- Offset is -25 --
Multibyte String:
mb_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
ValueError: mb_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
ASCII String:
mb_strrpos:
mb_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
ValueError: mb_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
strrpos:
strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
ValueError: strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)

-- Offset is -24 --
Multibyte String:
mb_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
ValueError: mb_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
ASCII String:
mb_strrpos:
mb_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
ValueError: mb_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
strrpos:
strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
ValueError: strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)

-- Offset is -13 --
Multibyte String:
Expand Down
8 changes: 4 additions & 4 deletions ext/mbstring/tests/bug43994.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ echo "Without \$regs arg:\n";
try {
var_dump( mb_ereg($input, 'hello, world') );
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}

echo "With \$regs arg:\n";
try {
var_dump(mb_ereg($input, 'hello, world', $mb_regs));
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}

var_dump($mb_regs);
Expand All @@ -35,9 +35,9 @@ var_dump($mb_regs);
Without $regs arg:

Deprecated: Function mb_ereg() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d
mb_ereg(): Argument #1 ($pattern) must not be empty
ValueError: mb_ereg(): Argument #1 ($pattern) must not be empty
With $regs arg:

Deprecated: Function mb_ereg() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d
mb_ereg(): Argument #1 ($pattern) must not be empty
ValueError: mb_ereg(): Argument #1 ($pattern) must not be empty
NULL
8 changes: 4 additions & 4 deletions ext/mbstring/tests/bug43998.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ $input = "";
try {
var_dump( mb_strtolower($sourcestring, $input) );
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
var_dump( mb_strtoupper($sourcestring, $input) );
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}

?>
--EXPECT--
mb_strtolower(): Argument #2 ($encoding) must be a valid encoding, "" given
mb_strtoupper(): Argument #2 ($encoding) must be a valid encoding, "" given
ValueError: mb_strtolower(): Argument #2 ($encoding) must be a valid encoding, "" given
ValueError: mb_strtoupper(): Argument #2 ($encoding) must be a valid encoding, "" given
34 changes: 17 additions & 17 deletions ext/mbstring/tests/bug45923.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function section($func, $haystack, $needle)
try {
var_dump($func($haystack, $needle, $offset));
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
}
}
Expand Down Expand Up @@ -44,15 +44,15 @@ bool(false)
> Offset: 11
bool(false)
> Offset: 12
strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
ValueError: strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
> Offset: -1
bool(false)
> Offset: -3
int(8)
> Offset: -6
int(8)
> Offset: -20
strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
ValueError: strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)

------- mb_strpos -----------

Expand All @@ -67,15 +67,15 @@ bool(false)
> Offset: 11
bool(false)
> Offset: 12
mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
ValueError: mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
> Offset: -1
bool(false)
> Offset: -3
int(8)
> Offset: -6
int(8)
> Offset: -20
mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
ValueError: mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)

------- stripos -----------

Expand All @@ -90,15 +90,15 @@ bool(false)
> Offset: 11
bool(false)
> Offset: 12
stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
ValueError: stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
> Offset: -1
bool(false)
> Offset: -3
int(8)
> Offset: -6
int(8)
> Offset: -20
stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
ValueError: stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)

------- mb_stripos -----------

Expand All @@ -113,15 +113,15 @@ bool(false)
> Offset: 11
bool(false)
> Offset: 12
mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
ValueError: mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
> Offset: -1
bool(false)
> Offset: -3
int(8)
> Offset: -6
int(8)
> Offset: -20
mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
ValueError: mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)

------- strrpos -----------

Expand All @@ -136,15 +136,15 @@ bool(false)
> Offset: 11
bool(false)
> Offset: 12
strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
ValueError: strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
> Offset: -1
int(8)
> Offset: -3
int(8)
> Offset: -6
int(4)
> Offset: -20
strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
ValueError: strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)

------- mb_strrpos -----------

Expand All @@ -159,15 +159,15 @@ bool(false)
> Offset: 11
bool(false)
> Offset: 12
mb_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
ValueError: mb_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
> Offset: -1
int(8)
> Offset: -3
int(8)
> Offset: -6
int(4)
> Offset: -20
mb_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
ValueError: mb_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)

------- strripos -----------

Expand All @@ -182,15 +182,15 @@ bool(false)
> Offset: 11
bool(false)
> Offset: 12
strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
ValueError: strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
> Offset: -1
int(8)
> Offset: -3
int(8)
> Offset: -6
int(4)
> Offset: -20
strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
ValueError: strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)

------- mb_strripos -----------

Expand All @@ -205,12 +205,12 @@ bool(false)
> Offset: 11
bool(false)
> Offset: 12
mb_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
ValueError: mb_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
> Offset: -1
int(8)
> Offset: -3
int(8)
> Offset: -6
int(4)
> Offset: -20
mb_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
ValueError: mb_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
8 changes: 4 additions & 4 deletions ext/mbstring/tests/bug69079.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ mb_substitute_character(0x3f); // Reset to '?', as the next call will fail
try {
var_dump(mb_substitute_character(0xD800)); // Surrogate (illegal)
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
var_dump(bin2hex(mb_scrub("\xff")));

Expand All @@ -22,7 +22,7 @@ mb_substitute_character(0x63); // Reset to '?', as the next call will fail
try {
mb_substitute_character(0x8fa1ef); // EUC-JP-2004 encoding of U+50AA (illegal)
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
var_dump(bin2hex(mb_scrub("\x8d")));

Expand All @@ -33,8 +33,8 @@ var_dump(bin2hex(mb_scrub("\x8d")));
--EXPECT--
bool(true)
string(8) "f09f9880"
mb_substitute_character(): Argument #1 ($substitute_character) is not a valid codepoint
ValueError: mb_substitute_character(): Argument #1 ($substitute_character) is not a valid codepoint
string(2) "3f"
mb_substitute_character(): Argument #1 ($substitute_character) is not a valid codepoint
ValueError: mb_substitute_character(): Argument #1 ($substitute_character) is not a valid codepoint
string(2) "63"
string(6) "8fa1ef"
4 changes: 2 additions & 2 deletions ext/mbstring/tests/bug72164.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ try {
$var8 = mb_ereg_replace($var2,$var3,$var3,$var0);
var_dump($var8);
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}

?>
--EXPECTF--
Deprecated: Function mb_ereg_replace() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d
Option "e" is not supported
ValueError: Option "e" is not supported
4 changes: 2 additions & 2 deletions ext/mbstring/tests/bug72399.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ var_dump($var6);
try {
$var13 = mb_ereg_search_pos();
} catch (\Error $e) {
echo $e->getMessage() . \PHP_EOL;
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECTF--
Expand All @@ -27,4 +27,4 @@ Deprecated: Function mb_eregi_replace() is deprecated since 8.6, because the und
string(0) ""

Deprecated: Function mb_ereg_search_pos() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d
No pattern was provided
Error: No pattern was provided
8 changes: 4 additions & 4 deletions ext/mbstring/tests/bug76704.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ mbstring
try {
var_dump(mb_detect_order('Foo, UTF-8'));
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
var_dump(mb_detect_order(['Foo', 'UTF-8']));
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
mb_detect_order(): Argument #1 ($encoding) contains invalid encoding "Foo"
mb_detect_order(): Argument #1 ($encoding) contains invalid encoding "Foo"
ValueError: mb_detect_order(): Argument #1 ($encoding) contains invalid encoding "Foo"
ValueError: mb_detect_order(): Argument #1 ($encoding) contains invalid encoding "Foo"
4 changes: 2 additions & 2 deletions ext/mbstring/tests/bug76999.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ var_dump(mb_regex_set_options("m"));
try {
var_dump(mb_regex_set_options("a"));
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
var_dump(mb_regex_set_options());
?>
Expand All @@ -32,7 +32,7 @@ Deprecated: Function mb_regex_set_options() is deprecated since 8.6, because the
string(3) "imd"

Deprecated: Function mb_regex_set_options() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d
Option "a" is not supported
ValueError: Option "a" is not supported

Deprecated: Function mb_regex_set_options() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d
string(2) "mr"
Loading
Loading