Improve some TypeError and ValueError messages

Closes GH-5377
This commit is contained in:
Máté Kocsis 2020-04-13 10:41:23 +02:00
parent 11c5c78401
commit 1f48feebb9
No known key found for this signature in database
GPG key ID: FD055E41728BF310
46 changed files with 188 additions and 189 deletions

View file

@ -345,7 +345,7 @@ PHP_FUNCTION(bzopen)
} }
if (mode_len != 1 || (mode[0] != 'r' && mode[0] != 'w')) { if (mode_len != 1 || (mode[0] != 'r' && mode[0] != 'w')) {
zend_argument_value_error(2, "must be a valid mode. Only 'w' and 'r' are supported"); zend_argument_value_error(2, "must be either 'r' or 'w'");
RETURN_THROWS(); RETURN_THROWS();
} }

View file

@ -37,15 +37,15 @@ var_dump(bzopen($fp, "r"));
?> ?>
--EXPECTF-- --EXPECTF--
bzopen(): Argument #2 ($mode) must be a valid mode. Only 'w' and 'r' are supported bzopen(): Argument #2 ($mode) must be either 'r' or 'w'
Warning: bzopen(): Filename cannot be empty in %s on line %d Warning: bzopen(): Filename cannot be empty in %s on line %d
bool(false) bool(false)
Warning: bzopen(): Filename cannot be empty in %s on line %d Warning: bzopen(): Filename cannot be empty in %s on line %d
bool(false) bool(false)
bzopen(): Argument #2 ($mode) must be a valid mode. Only 'w' and 'r' are supported bzopen(): Argument #2 ($mode) must be either 'r' or 'w'
bzopen(): Argument #2 ($mode) must be a valid mode. Only 'w' and 'r' are supported bzopen(): Argument #2 ($mode) must be either 'r' or 'w'
Warning: bzopen(no_such_file): Failed to open stream: No such file or directory in %s on line %d Warning: bzopen(no_such_file): Failed to open stream: No such file or directory in %s on line %d
bool(false) bool(false)

View file

@ -338,7 +338,7 @@ PHP_MINIT_FUNCTION(gd)
/* GD2 image format types */ /* GD2 image format types */
REGISTER_LONG_CONSTANT("IMG_GD2_RAW", GD2_FMT_RAW, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("IMG_GD2_RAW", GD2_FMT_RAW, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("IMG_GD2_COMPRESSED", GD2_FMT_COMPRESSED, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("IMG_GD2_COMPRESSED", GD2_FMT_COMPRESSED, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("IMG_FLIP_HORIZONTAL", GD_FLIP_HORINZONTAL, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("IMG_FLIP_HORIZONTAL", GD_FLIP_HORIZONTAL, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("IMG_FLIP_VERTICAL", GD_FLIP_VERTICAL, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("IMG_FLIP_VERTICAL", GD_FLIP_VERTICAL, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("IMG_FLIP_BOTH", GD_FLIP_BOTH, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("IMG_FLIP_BOTH", GD_FLIP_BOTH, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("IMG_EFFECT_REPLACE", gdEffectReplace, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("IMG_EFFECT_REPLACE", gdEffectReplace, CONST_CS | CONST_PERSISTENT);
@ -3536,7 +3536,7 @@ PHP_FUNCTION(imageflip)
gdImageFlipVertical(im); gdImageFlipVertical(im);
break; break;
case GD_FLIP_HORINZONTAL: case GD_FLIP_HORIZONTAL:
gdImageFlipHorizontal(im); gdImageFlipHorizontal(im);
break; break;
@ -3545,7 +3545,7 @@ PHP_FUNCTION(imageflip)
break; break;
default: default:
zend_argument_value_error(2, "must be a valid mode"); zend_argument_value_error(2, "must be either IMG_FLIP_VERTICAL, IMG_FLIP_HORIZONTAL, or IMG_FLIP_BOTH");
RETURN_THROWS(); RETURN_THROWS();
} }

View file

@ -824,7 +824,7 @@ void gdImageFlipHorizontal(gdImagePtr im);
void gdImageFlipVertical(gdImagePtr im); void gdImageFlipVertical(gdImagePtr im);
void gdImageFlipBoth(gdImagePtr im); void gdImageFlipBoth(gdImagePtr im);
#define GD_FLIP_HORINZONTAL 1 #define GD_FLIP_HORIZONTAL 1
#define GD_FLIP_VERTICAL 2 #define GD_FLIP_VERTICAL 2
#define GD_FLIP_BOTH 3 #define GD_FLIP_BOTH 3

View file

@ -36,12 +36,12 @@ var_dump(iconv_strpos("string", ""));
var_dump(iconv_strpos("", "string")); var_dump(iconv_strpos("", "string"));
?> ?>
--EXPECTF-- --EXPECT--
bool(false) bool(false)
bool(false) bool(false)
int(5) int(5)
int(5) int(5)
Offset not contained in string strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
bool(false) bool(false)
int(7) int(7)
int(7) int(7)

View file

@ -1986,10 +1986,10 @@ static void handle_strpos_error(size_t error) {
php_error_docref(NULL, E_WARNING, "Conversion error"); php_error_docref(NULL, E_WARNING, "Conversion error");
break; break;
case MBFL_ERROR_OFFSET: case MBFL_ERROR_OFFSET:
zend_value_error("Offset not contained in string"); zend_argument_value_error(3, "must be contained in argument #1 ($haystack)");
break; break;
default: default:
zend_value_error("Unknown error in mb_strpos"); zend_value_error("mb_strpos(): Unknown error");
break; break;
} }
} }

View file

@ -54,18 +54,18 @@ bool(false)
-- Offset is 22 -- -- Offset is 22 --
--Multibyte String:-- --Multibyte String:--
Offset not contained in string mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
--ASCII String:-- --ASCII String:--
Offset not contained in string mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
-- Offset is 53 -- -- Offset is 53 --
--Multibyte String:-- --Multibyte String:--
Offset not contained in string mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
--ASCII String:-- --ASCII String:--
Offset not contained in string mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
-- Offset is 54 -- -- Offset is 54 --
--Multibyte String:-- --Multibyte String:--
Offset not contained in string mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
--ASCII String:-- --ASCII String:--
Offset not contained in string mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)

View file

@ -47,21 +47,21 @@ foreach ($offsets as $i) {
--EXPECT-- --EXPECT--
-- Offset is -25 -- -- Offset is -25 --
Multibyte String: Multibyte String:
Offset not contained in string mb_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
ASCII String: ASCII String:
mb_strrpos: mb_strrpos:
Offset not contained in string mb_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
strrpos: strrpos:
Offset not contained in string strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
-- Offset is -24 -- -- Offset is -24 --
Multibyte String: Multibyte String:
Offset not contained in string mb_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
ASCII String: ASCII String:
mb_strrpos: mb_strrpos:
Offset not contained in string mb_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
strrpos: strrpos:
Offset not contained in string strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
-- Offset is -13 -- -- Offset is -13 --
Multibyte String: Multibyte String:

View file

@ -44,7 +44,7 @@ bool(false)
> Offset: 11 > Offset: 11
bool(false) bool(false)
> Offset: 12 > Offset: 12
Offset not contained in string strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
> Offset: -1 > Offset: -1
bool(false) bool(false)
> Offset: -3 > Offset: -3
@ -52,7 +52,7 @@ int(8)
> Offset: -6 > Offset: -6
int(8) int(8)
> Offset: -20 > Offset: -20
Offset not contained in string strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
------- mb_strpos ----------- ------- mb_strpos -----------
@ -67,7 +67,7 @@ bool(false)
> Offset: 11 > Offset: 11
bool(false) bool(false)
> Offset: 12 > Offset: 12
Offset not contained in string mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
> Offset: -1 > Offset: -1
bool(false) bool(false)
> Offset: -3 > Offset: -3
@ -75,7 +75,7 @@ int(8)
> Offset: -6 > Offset: -6
int(8) int(8)
> Offset: -20 > Offset: -20
Offset not contained in string mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
------- stripos ----------- ------- stripos -----------
@ -90,7 +90,7 @@ bool(false)
> Offset: 11 > Offset: 11
bool(false) bool(false)
> Offset: 12 > Offset: 12
Offset not contained in string stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
> Offset: -1 > Offset: -1
bool(false) bool(false)
> Offset: -3 > Offset: -3
@ -98,7 +98,7 @@ int(8)
> Offset: -6 > Offset: -6
int(8) int(8)
> Offset: -20 > Offset: -20
Offset not contained in string stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
------- mb_stripos ----------- ------- mb_stripos -----------
@ -113,7 +113,7 @@ bool(false)
> Offset: 11 > Offset: 11
bool(false) bool(false)
> Offset: 12 > Offset: 12
Offset not contained in string mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
> Offset: -1 > Offset: -1
bool(false) bool(false)
> Offset: -3 > Offset: -3
@ -121,7 +121,7 @@ int(8)
> Offset: -6 > Offset: -6
int(8) int(8)
> Offset: -20 > Offset: -20
Offset not contained in string mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
------- strrpos ----------- ------- strrpos -----------
@ -136,7 +136,7 @@ bool(false)
> Offset: 11 > Offset: 11
bool(false) bool(false)
> Offset: 12 > Offset: 12
Offset not contained in string strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
> Offset: -1 > Offset: -1
int(8) int(8)
> Offset: -3 > Offset: -3
@ -144,7 +144,7 @@ int(8)
> Offset: -6 > Offset: -6
int(4) int(4)
> Offset: -20 > Offset: -20
Offset not contained in string strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
------- mb_strrpos ----------- ------- mb_strrpos -----------
@ -159,7 +159,7 @@ bool(false)
> Offset: 11 > Offset: 11
bool(false) bool(false)
> Offset: 12 > Offset: 12
Offset not contained in string mb_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
> Offset: -1 > Offset: -1
int(8) int(8)
> Offset: -3 > Offset: -3
@ -167,7 +167,7 @@ int(8)
> Offset: -6 > Offset: -6
int(4) int(4)
> Offset: -20 > Offset: -20
Offset not contained in string mb_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
------- strripos ----------- ------- strripos -----------
@ -182,7 +182,7 @@ bool(false)
> Offset: 11 > Offset: 11
bool(false) bool(false)
> Offset: 12 > Offset: 12
Offset not contained in string strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
> Offset: -1 > Offset: -1
int(8) int(8)
> Offset: -3 > Offset: -3
@ -190,7 +190,7 @@ int(8)
> Offset: -6 > Offset: -6
int(4) int(4)
> Offset: -20 > Offset: -20
Offset not contained in string strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
------- mb_strripos ----------- ------- mb_strripos -----------
@ -205,7 +205,7 @@ bool(false)
> Offset: 11 > Offset: 11
bool(false) bool(false)
> Offset: 12 > Offset: 12
Offset not contained in string mb_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
> Offset: -1 > Offset: -1
int(8) int(8)
> Offset: -3 > Offset: -3
@ -213,4 +213,4 @@ int(8)
> Offset: -6 > Offset: -6
int(4) int(4)
> Offset: -20 > Offset: -20
Offset not contained in string mb_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)

View file

@ -73,10 +73,10 @@ int(2)
int(5) int(5)
-- ASCII string with out of bound positive offset -- -- ASCII string with out of bound positive offset --
Offset not contained in string mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
-- ASCII string with out of bound negative offset -- -- ASCII string with out of bound negative offset --
Offset not contained in string mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
-- Multi-byte string without offset -- -- Multi-byte string without offset --
int(0) int(0)
@ -88,7 +88,7 @@ int(2)
int(19) int(19)
-- Multi-byte string with out of bound positive offset -- -- Multi-byte string with out of bound positive offset --
Offset not contained in string mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
-- Multi-byte string with out of bound negative offset -- -- Multi-byte string with out of bound negative offset --
Offset not contained in string mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)

View file

@ -81,13 +81,13 @@ try {
--EXPECT-- --EXPECT--
String len: 42 String len: 42
== INVALID OFFSET == == INVALID OFFSET ==
Offset not contained in string mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
Offset not contained in string mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
Offset not contained in string mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
Offset not contained in string mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
Offset not contained in string mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
Offset not contained in string mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
Offset not contained in string mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
Offset not contained in string mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
Offset not contained in string mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
Offset not contained in string mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)

View file

@ -55,9 +55,9 @@ for ($i = -30; $i <= 60; $i += 10) {
**-- Offset is: -30 --** **-- Offset is: -30 --**
-- ASCII String -- -- ASCII String --
Offset not contained in string mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
--Multibyte String -- --Multibyte String --
Offset not contained in string mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
**-- Offset is: -20 --** **-- Offset is: -20 --**
-- ASCII String -- -- ASCII String --
@ -91,24 +91,24 @@ int(20)
**-- Offset is: 30 --** **-- Offset is: 30 --**
-- ASCII String -- -- ASCII String --
Offset not contained in string mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
--Multibyte String -- --Multibyte String --
Offset not contained in string mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
**-- Offset is: 40 --** **-- Offset is: 40 --**
-- ASCII String -- -- ASCII String --
Offset not contained in string mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
--Multibyte String -- --Multibyte String --
Offset not contained in string mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
**-- Offset is: 50 --** **-- Offset is: 50 --**
-- ASCII String -- -- ASCII String --
Offset not contained in string mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
--Multibyte String -- --Multibyte String --
Offset not contained in string mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
**-- Offset is: 60 --** **-- Offset is: 60 --**
-- ASCII String -- -- ASCII String --
Offset not contained in string mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
--Multibyte String -- --Multibyte String --
Offset not contained in string mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)

View file

@ -72,10 +72,10 @@ int(2)
int(5) int(5)
-- ASCII string with out of bound positive offset -- -- ASCII string with out of bound positive offset --
Offset not contained in string mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
-- ASCII string with out of bound negative offset -- -- ASCII string with out of bound negative offset --
Offset not contained in string mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
-- Multi-byte string without offset -- -- Multi-byte string without offset --
int(0) int(0)
@ -87,7 +87,7 @@ int(2)
int(19) int(19)
-- Multi-byte string with out of bound positive offset -- -- Multi-byte string with out of bound positive offset --
Offset not contained in string mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
-- Multi-byte string with out of bound negative offset -- -- Multi-byte string with out of bound negative offset --
Offset not contained in string mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)

View file

@ -81,13 +81,13 @@ try {
--EXPECT-- --EXPECT--
String len: 42 String len: 42
== INVALID OFFSET == == INVALID OFFSET ==
Offset not contained in string mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
Offset not contained in string mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
Offset not contained in string mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
Offset not contained in string mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
Offset not contained in string mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
Offset not contained in string mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
Offset not contained in string mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
Offset not contained in string mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
Offset not contained in string mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
Offset not contained in string mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)

View file

@ -46,11 +46,11 @@ try {
?> ?>
--EXPECT-- --EXPECT--
Offset not contained in string mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
Offset not contained in string mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
Offset not contained in string mb_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
Offset not contained in string mb_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
Offset not contained in string mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
Offset not contained in string mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
Offset not contained in string mb_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
Offset not contained in string mb_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)

View file

@ -55,9 +55,9 @@ for ($i = -30; $i <= 60; $i += 10) {
**-- Offset is: -30 --** **-- Offset is: -30 --**
-- ASCII String -- -- ASCII String --
Offset not contained in string mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
--Multibyte String -- --Multibyte String --
Offset not contained in string mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
**-- Offset is: -20 --** **-- Offset is: -20 --**
-- ASCII String -- -- ASCII String --
@ -91,24 +91,24 @@ int(20)
**-- Offset is: 30 --** **-- Offset is: 30 --**
-- ASCII String -- -- ASCII String --
Offset not contained in string mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
--Multibyte String -- --Multibyte String --
Offset not contained in string mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
**-- Offset is: 40 --** **-- Offset is: 40 --**
-- ASCII String -- -- ASCII String --
Offset not contained in string mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
--Multibyte String -- --Multibyte String --
Offset not contained in string mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
**-- Offset is: 50 --** **-- Offset is: 50 --**
-- ASCII String -- -- ASCII String --
Offset not contained in string mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
--Multibyte String -- --Multibyte String --
Offset not contained in string mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
**-- Offset is: 60 --** **-- Offset is: 60 --**
-- ASCII String -- -- ASCII String --
Offset not contained in string mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
--Multibyte String -- --Multibyte String --
Offset not contained in string mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)

View file

@ -73,10 +73,10 @@ int(7)
int(5) int(5)
-- ASCII string with out of bound positive offset -- -- ASCII string with out of bound positive offset --
Offset not contained in string mb_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
-- ASCII string with out of bound negative offset -- -- ASCII string with out of bound negative offset --
Offset not contained in string mb_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
-- Multi-byte string without offset -- -- Multi-byte string without offset --
int(21) int(21)
@ -88,7 +88,7 @@ int(21)
int(19) int(19)
-- Multi-byte string with out of bound positive offset -- -- Multi-byte string with out of bound positive offset --
Offset not contained in string mb_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
-- Multi-byte string with out of bound negative offset -- -- Multi-byte string with out of bound negative offset --
Offset not contained in string mb_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)

View file

@ -81,24 +81,24 @@ int(20)
**-- Offset is: 30 --** **-- Offset is: 30 --**
-- ASCII String -- -- ASCII String --
Offset not contained in string mb_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
--Multibyte String -- --Multibyte String --
Offset not contained in string mb_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
**-- Offset is: 40 --** **-- Offset is: 40 --**
-- ASCII String -- -- ASCII String --
Offset not contained in string mb_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
--Multibyte String -- --Multibyte String --
Offset not contained in string mb_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
**-- Offset is: 50 --** **-- Offset is: 50 --**
-- ASCII String -- -- ASCII String --
Offset not contained in string mb_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
--Multibyte String -- --Multibyte String --
Offset not contained in string mb_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
**-- Offset is: 60 --** **-- Offset is: 60 --**
-- ASCII String -- -- ASCII String --
Offset not contained in string mb_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
--Multibyte String -- --Multibyte String --
Offset not contained in string mb_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)

View file

@ -73,10 +73,10 @@ int(7)
int(5) int(5)
-- ASCII string with out of bound positive offset -- -- ASCII string with out of bound positive offset --
Offset not contained in string mb_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
-- ASCII string with out of bound negative offset -- -- ASCII string with out of bound negative offset --
Offset not contained in string mb_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
-- Multi-byte string without offset -- -- Multi-byte string without offset --
int(21) int(21)
@ -88,7 +88,7 @@ int(21)
int(19) int(19)
-- Multi-byte string with out of bound positive offset -- -- Multi-byte string with out of bound positive offset --
Offset not contained in string mb_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
-- Multi-byte string with out of bound negative offset -- -- Multi-byte string with out of bound negative offset --
Offset not contained in string mb_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)

View file

@ -5335,7 +5335,7 @@ ZEND_METHOD(ReflectionProperty, getValue)
zval rv; zval rv;
if (!object) { if (!object) {
zend_type_error("No object provided for getValue() on instance property"); zend_argument_type_error(1, "must be provided for instance properties");
RETURN_THROWS(); RETURN_THROWS();
} }
@ -5428,7 +5428,7 @@ ZEND_METHOD(ReflectionProperty, isInitialized)
int retval; int retval;
if (!object) { if (!object) {
zend_type_error("No object provided for isInitialized() on instance property"); zend_argument_type_error(1, "must be provided for instance properties");
RETURN_THROWS(); RETURN_THROWS();
} }

View file

@ -66,4 +66,4 @@ Invalid instance:
Given object is not an instance of the class this property was declared in Given object is not an instance of the class this property was declared in
Missing instance: Missing instance:
No object provided for getValue() on instance property ReflectionProperty::getValue(): Argument #1 ($object) must be provided for instance properties

View file

@ -114,7 +114,7 @@ bool(false)
Object type: Object type:
bool(false) bool(false)
Given object is not an instance of the class this property was declared in Given object is not an instance of the class this property was declared in
No object provided for isInitialized() on instance property ReflectionProperty::isInitialized(): Argument #1 ($object) must be provided for instance properties
Class with __isset: Class with __isset:
bool(false) bool(false)
bool(false) bool(false)

View file

@ -704,7 +704,7 @@ PHP_FUNCTION(count)
ZEND_PARSE_PARAMETERS_END(); ZEND_PARSE_PARAMETERS_END();
if (mode != COUNT_NORMAL && mode != COUNT_RECURSIVE) { if (mode != COUNT_NORMAL && mode != COUNT_RECURSIVE) {
zend_argument_value_error(2, "must be a valid mode"); zend_argument_value_error(2, "must be either COUNT_NORMAL or COUNT_RECURSIVE");
RETURN_THROWS(); RETURN_THROWS();
} }
@ -4087,8 +4087,7 @@ PHP_FUNCTION(array_count_values)
* Specialized conversion rules for array_column() function * Specialized conversion rules for array_column() function
*/ */
static inline static inline
zend_bool array_column_param_helper(zval *param, zend_bool array_column_param_helper(zval *param, int parameter_number) {
const char *name) {
switch (Z_TYPE_P(param)) { switch (Z_TYPE_P(param)) {
case IS_DOUBLE: case IS_DOUBLE:
convert_to_long_ex(param); convert_to_long_ex(param);
@ -4105,7 +4104,7 @@ zend_bool array_column_param_helper(zval *param,
return 1; return 1;
default: default:
zend_type_error("The %s key should be either a string or an integer", name); zend_argument_type_error(parameter_number, "must be of type string|int, %s given", zend_zval_type_name(param));
return 0; return 0;
} }
} }
@ -4166,9 +4165,9 @@ PHP_FUNCTION(array_column)
Z_PARAM_ZVAL_EX(index, 1, 0) Z_PARAM_ZVAL_EX(index, 1, 0)
ZEND_PARSE_PARAMETERS_END(); ZEND_PARSE_PARAMETERS_END();
if ((column && !array_column_param_helper(column, "column")) || if ((column && !array_column_param_helper(column, 2)) ||
(index && !array_column_param_helper(index, "index"))) { (index && !array_column_param_helper(index, 3))) {
return; RETURN_THROWS();
} }
array_init_size(return_value, zend_hash_num_elements(input)); array_init_size(return_value, zend_hash_num_elements(input));

View file

@ -254,7 +254,7 @@ PHP_FUNCTION(closedir)
FETCH_DIRP(); FETCH_DIRP();
if (!(dirp->flags & PHP_STREAM_FLAG_IS_DIR)) { if (!(dirp->flags & PHP_STREAM_FLAG_IS_DIR)) {
zend_type_error("%d is not a valid Directory resource", dirp->res->handle); zend_argument_type_error(1, "must be a valid Directory resource");
RETURN_THROWS(); RETURN_THROWS();
} }
@ -368,7 +368,7 @@ PHP_FUNCTION(rewinddir)
FETCH_DIRP(); FETCH_DIRP();
if (!(dirp->flags & PHP_STREAM_FLAG_IS_DIR)) { if (!(dirp->flags & PHP_STREAM_FLAG_IS_DIR)) {
zend_type_error("%d is not a valid Directory resource", dirp->res->handle); zend_argument_type_error(1, "must be a valid Directory resource");
RETURN_THROWS(); RETURN_THROWS();
} }

View file

@ -1889,7 +1889,7 @@ PHP_FUNCTION(strpos)
offset += (zend_long)ZSTR_LEN(haystack); offset += (zend_long)ZSTR_LEN(haystack);
} }
if (offset < 0 || (size_t)offset > ZSTR_LEN(haystack)) { if (offset < 0 || (size_t)offset > ZSTR_LEN(haystack)) {
zend_value_error("Offset not contained in string"); zend_argument_value_error(3, "must be contained in argument #1 ($haystack)");
RETURN_THROWS(); RETURN_THROWS();
} }
@ -1925,7 +1925,7 @@ PHP_FUNCTION(stripos)
offset += (zend_long)ZSTR_LEN(haystack); offset += (zend_long)ZSTR_LEN(haystack);
} }
if (offset < 0 || (size_t)offset > ZSTR_LEN(haystack)) { if (offset < 0 || (size_t)offset > ZSTR_LEN(haystack)) {
zend_value_error("Offset not contained in string"); zend_argument_value_error(3, "must be contained in argument #1 ($haystack)");
RETURN_THROWS(); RETURN_THROWS();
} }
@ -1967,14 +1967,14 @@ PHP_FUNCTION(strrpos)
if (offset >= 0) { if (offset >= 0) {
if ((size_t)offset > ZSTR_LEN(haystack)) { if ((size_t)offset > ZSTR_LEN(haystack)) {
zend_value_error("Offset not contained in string"); zend_argument_value_error(3, "must be contained in argument #1 ($haystack)");
RETURN_THROWS(); RETURN_THROWS();
} }
p = ZSTR_VAL(haystack) + (size_t)offset; p = ZSTR_VAL(haystack) + (size_t)offset;
e = ZSTR_VAL(haystack) + ZSTR_LEN(haystack); e = ZSTR_VAL(haystack) + ZSTR_LEN(haystack);
} else { } else {
if (offset < -ZEND_LONG_MAX || (size_t)(-offset) > ZSTR_LEN(haystack)) { if (offset < -ZEND_LONG_MAX || (size_t)(-offset) > ZSTR_LEN(haystack)) {
zend_value_error("Offset not contained in string"); zend_argument_value_error(3, "must be contained in argument #1 ($haystack)");
RETURN_THROWS(); RETURN_THROWS();
} }
@ -2017,7 +2017,7 @@ PHP_FUNCTION(strripos)
char lowered; char lowered;
if (offset >= 0) { if (offset >= 0) {
if ((size_t)offset > ZSTR_LEN(haystack)) { if ((size_t)offset > ZSTR_LEN(haystack)) {
zend_value_error("Offset not contained in string"); zend_argument_value_error(3, "must be contained in argument #1 ($haystack)");
RETURN_THROWS(); RETURN_THROWS();
} }
p = ZSTR_VAL(haystack) + (size_t)offset; p = ZSTR_VAL(haystack) + (size_t)offset;
@ -2025,7 +2025,7 @@ PHP_FUNCTION(strripos)
} else { } else {
p = ZSTR_VAL(haystack); p = ZSTR_VAL(haystack);
if (offset < -ZEND_LONG_MAX || (size_t)(-offset) > ZSTR_LEN(haystack)) { if (offset < -ZEND_LONG_MAX || (size_t)(-offset) > ZSTR_LEN(haystack)) {
zend_value_error("Offset not contained in string"); zend_argument_value_error(3, "must be contained in argument #1 ($haystack)");
RETURN_THROWS(); RETURN_THROWS();
} }
e = ZSTR_VAL(haystack) + (ZSTR_LEN(haystack) + (size_t)offset); e = ZSTR_VAL(haystack) + (ZSTR_LEN(haystack) + (size_t)offset);
@ -2045,7 +2045,7 @@ PHP_FUNCTION(strripos)
if (offset >= 0) { if (offset >= 0) {
if ((size_t)offset > ZSTR_LEN(haystack)) { if ((size_t)offset > ZSTR_LEN(haystack)) {
zend_string_release_ex(haystack_dup, 0); zend_string_release_ex(haystack_dup, 0);
zend_value_error("Offset not contained in string"); zend_argument_value_error(3, "must be contained in argument #1 ($haystack)");
RETURN_THROWS(); RETURN_THROWS();
} }
p = ZSTR_VAL(haystack_dup) + offset; p = ZSTR_VAL(haystack_dup) + offset;
@ -2053,7 +2053,7 @@ PHP_FUNCTION(strripos)
} else { } else {
if (offset < -ZEND_LONG_MAX || (size_t)(-offset) > ZSTR_LEN(haystack)) { if (offset < -ZEND_LONG_MAX || (size_t)(-offset) > ZSTR_LEN(haystack)) {
zend_string_release_ex(haystack_dup, 0); zend_string_release_ex(haystack_dup, 0);
zend_value_error("Offset not contained in string"); zend_argument_value_error(3, "must be contained in argument #1 ($haystack)");
RETURN_THROWS(); RETURN_THROWS();
} }
@ -5273,7 +5273,7 @@ PHP_FUNCTION(str_repeat)
ZEND_PARSE_PARAMETERS_END(); ZEND_PARSE_PARAMETERS_END();
if (mult < 0) { if (mult < 0) {
zend_value_error("Second argument has to be greater than or equal to 0"); zend_argument_value_error(2, "must be greater than or equal to 0");
RETURN_THROWS(); RETURN_THROWS();
} }
@ -5331,7 +5331,7 @@ PHP_FUNCTION(count_chars)
ZEND_PARSE_PARAMETERS_END(); ZEND_PARSE_PARAMETERS_END();
if (mymode < 0 || mymode > 4) { if (mymode < 0 || mymode > 4) {
zend_value_error("Unknown mode"); zend_argument_value_error(2, "must be between 1 and 4 (inclusive)");
RETURN_THROWS(); RETURN_THROWS();
} }

View file

@ -46,15 +46,15 @@ DONE
*** Testing array_column() : error conditions *** *** Testing array_column() : error conditions ***
-- Testing array_column() column key parameter should be a string or an integer (testing bool) -- -- Testing array_column() column key parameter should be a string or an integer (testing bool) --
The column key should be either a string or an integer array_column(): Argument #2 ($column_key) must be of type string|int, bool given
-- Testing array_column() column key parameter should be a string or integer (testing array) -- -- Testing array_column() column key parameter should be a string or integer (testing array) --
The column key should be either a string or an integer array_column(): Argument #2 ($column_key) must be of type string|int, array given
-- Testing array_column() index key parameter should be a string or an integer (testing bool) -- -- Testing array_column() index key parameter should be a string or an integer (testing bool) --
The index key should be either a string or an integer array_column(): Argument #3 ($index_key) must be of type string|int, bool given
-- Testing array_column() index key parameter should be a string or integer (testing array) -- -- Testing array_column() index key parameter should be a string or integer (testing array) --
The index key should be either a string or an integer array_column(): Argument #3 ($index_key) must be of type string|int, array given
DONE DONE

View file

@ -29,9 +29,9 @@ int(0)
int(0) int(0)
int(0) int(0)
int(0) int(0)
count(): Argument #2 ($mode) must be a valid mode count(): Argument #2 ($mode) must be either COUNT_NORMAL or COUNT_RECURSIVE
count(): Argument #2 ($mode) must be a valid mode count(): Argument #2 ($mode) must be either COUNT_NORMAL or COUNT_RECURSIVE
count(): Argument #2 ($mode) must be a valid mode count(): Argument #2 ($mode) must be either COUNT_NORMAL or COUNT_RECURSIVE
int(0) int(0)
int(0) int(0)
int(0) int(0)

View file

@ -37,7 +37,7 @@ if(is_resource($fp)) {
resource(%d) of type (stream) resource(%d) of type (stream)
-- Try to close the file pointer using closedir() -- -- Try to close the file pointer using closedir() --
%d is not a valid Directory resource closedir(): Argument #1 ($dir_handle) must be a valid Directory resource
-- Check file pointer: -- -- Check file pointer: --
resource(%d) of type (stream) resource(%d) of type (stream)

View file

@ -38,7 +38,7 @@ if ($result1 === $result2) {
-- Open a file using fopen -- -- Open a file using fopen --
resource(%d) of type (stream) resource(%d) of type (stream)
%d is not a valid Directory resource rewinddir(): Argument #1 ($dir_handle) must be a valid Directory resource
-- Check if rewinddir() has repositioned the file pointer -- -- Check if rewinddir() has repositioned the file pointer --
rewinddir() does not work on file pointers rewinddir() does not work on file pointers

View file

@ -104,8 +104,8 @@ var_dump(is_array(unserialize(
?> ?>
--EXPECTF-- --EXPECTF--
Invalid max_depth: Invalid max_depth:
max_depth should be int unserialize(): 'max_depth' option must be of type int, string given
max_depth cannot be negative unserialize(): 'max_depth' option must be greater than or equal to 0
Array: Array:
bool(true) bool(true)

View file

@ -71,15 +71,15 @@ substr_count(): Argument #3 ($offset) must be contained in argument #1 ($haystac
Warning: substr_compare(): The start position cannot exceed initial string length in %s on line %d Warning: substr_compare(): The start position cannot exceed initial string length in %s on line %d
bool(false) bool(false)
Offset not contained in string stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
substr_count(): Argument #3 ($offset) must be contained in argument #1 ($haystack) substr_count(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
Warning: substr_count(): Invalid length value in %s on line %d Warning: substr_count(): Invalid length value in %s on line %d
bool(false) bool(false)
Offset not contained in string strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
Offset not contained in string stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
Offset not contained in string strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
Offset not contained in string strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
int(2) int(2)
string(8) "abcdeabc" string(8) "abcdeabc"
bool(false) bool(false)

View file

@ -1575,4 +1575,4 @@ array(238) {
} }
string(18) " Rabcdefghimnorstu" string(18) " Rabcdefghimnorstu"
string(476) "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f2122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f5051535455565758595a5b5c5d5e5f606a6b6c7071767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff" string(476) "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f2122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f5051535455565758595a5b5c5d5e5f606a6b6c7071767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff"
Unknown mode count_chars(): Argument #2 ($mode) must be between 1 and 4 (inclusive)

View file

@ -29,8 +29,8 @@ echo "*** Done ***";
*** Testing stripos() function: error conditions *** *** Testing stripos() function: error conditions ***
-- Offset beyond the end of the string -- -- Offset beyond the end of the string --
Offset not contained in string stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
-- Offset before the start of the string -- -- Offset before the start of the string --
Offset not contained in string stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
*** Done *** *** Done ***

View file

@ -145,35 +145,35 @@ int(0)
bool(false) bool(false)
-- Iteration 16 -- -- Iteration 16 --
int(0) int(0)
ValueError: Offset not contained in string ValueError: stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
-- Iteration 17 -- -- Iteration 17 --
int(0) int(0)
bool(false) bool(false)
-- Iteration 18 -- -- Iteration 18 --
int(0) int(0)
ValueError: Offset not contained in string ValueError: stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
-- Iteration 19 -- -- Iteration 19 --
int(0) int(0)
bool(false) bool(false)
-- Iteration 20 -- -- Iteration 20 --
int(0) int(0)
ValueError: Offset not contained in string ValueError: stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
-- Iteration 21 -- -- Iteration 21 --
int(0) int(0)
ValueError: Offset not contained in string ValueError: stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
-- Iteration 22 -- -- Iteration 22 --
int(0) int(0)
ValueError: Offset not contained in string ValueError: stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
-- Iteration 23 -- -- Iteration 23 --
int(0) int(0)
ValueError: Offset not contained in string ValueError: stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
-- Iteration 24 -- -- Iteration 24 --
TypeError: stripos(): Argument #1 ($haystack) must be of type string, resource given TypeError: stripos(): Argument #1 ($haystack) must be of type string, resource given
TypeError: stripos(): Argument #1 ($haystack) must be of type string, resource given TypeError: stripos(): Argument #1 ($haystack) must be of type string, resource given
-- Iteration 25 -- -- Iteration 25 --
int(0) int(0)
ValueError: Offset not contained in string ValueError: stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
-- Iteration 26 -- -- Iteration 26 --
int(0) int(0)
ValueError: Offset not contained in string ValueError: stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
*** Done *** *** Done ***

View file

@ -31,7 +31,7 @@ echo "*** Done ***";
*** Testing stripos() function: with heredoc strings *** *** Testing stripos() function: with heredoc strings ***
-- With empty heredoc string -- -- With empty heredoc string --
int(0) int(0)
Offset not contained in string stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
int(0) int(0)
int(0) int(0)
*** Done *** *** Done ***

View file

@ -37,8 +37,8 @@ echo "Done\n";
?> ?>
--EXPECT-- --EXPECT--
strripos(): Argument #3 ($offset) must be of type int, float given strripos(): Argument #3 ($offset) must be of type int, float given
Offset not contained in string strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
Offset not contained in string strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
Offset not contained in string strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
Offset not contained in string strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
Done Done

View file

@ -32,11 +32,11 @@ int(7)
bool(false) bool(false)
int(5) int(5)
int(1) int(1)
Offset not contained in string strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
int(0) int(0)
int(0) int(0)
int(7) int(7)
bool(false) bool(false)
int(5) int(5)
int(1) int(1)
Offset not contained in string strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)

View file

@ -37,8 +37,8 @@ echo "Done\n";
?> ?>
--EXPECT-- --EXPECT--
strrpos(): Argument #3 ($offset) must be of type int, float given strrpos(): Argument #3 ($offset) must be of type int, float given
Offset not contained in string strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
Offset not contained in string strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
Offset not contained in string strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
Offset not contained in string strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
Done Done

View file

@ -146,35 +146,35 @@ int(0)
bool(false) bool(false)
-- Iteration 16 -- -- Iteration 16 --
int(0) int(0)
ValueError: Offset not contained in string ValueError: strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
-- Iteration 17 -- -- Iteration 17 --
int(0) int(0)
bool(false) bool(false)
-- Iteration 18 -- -- Iteration 18 --
int(0) int(0)
ValueError: Offset not contained in string ValueError: strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
-- Iteration 19 -- -- Iteration 19 --
int(0) int(0)
bool(false) bool(false)
-- Iteration 20 -- -- Iteration 20 --
int(0) int(0)
ValueError: Offset not contained in string ValueError: strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
-- Iteration 21 -- -- Iteration 21 --
int(0) int(0)
ValueError: Offset not contained in string ValueError: strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
-- Iteration 22 -- -- Iteration 22 --
int(0) int(0)
ValueError: Offset not contained in string ValueError: strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
-- Iteration 23 -- -- Iteration 23 --
int(0) int(0)
ValueError: Offset not contained in string ValueError: strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
-- Iteration 24 -- -- Iteration 24 --
TypeError: strrpos(): Argument #1 ($haystack) must be of type string, resource given TypeError: strrpos(): Argument #1 ($haystack) must be of type string, resource given
TypeError: strrpos(): Argument #1 ($haystack) must be of type string, resource given TypeError: strrpos(): Argument #1 ($haystack) must be of type string, resource given
-- Iteration 25 -- -- Iteration 25 --
int(0) int(0)
ValueError: Offset not contained in string ValueError: strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
-- Iteration 26 -- -- Iteration 26 --
int(0) int(0)
ValueError: Offset not contained in string ValueError: strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
*** Done *** *** Done ***

View file

@ -30,7 +30,7 @@ echo "*** Done ***";
*** Testing strrpos() function: with heredoc strings *** *** Testing strrpos() function: with heredoc strings ***
-- With empty heredoc string -- -- With empty heredoc string --
int(0) int(0)
Offset not contained in string strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
int(0) int(0)
int(0) int(0)
*** Done *** *** Done ***

View file

@ -416,7 +416,7 @@ static void php_stream_bucket_attach(int append, INTERNAL_FUNCTION_PARAMETERS)
ZEND_PARSE_PARAMETERS_END(); ZEND_PARSE_PARAMETERS_END();
if (NULL == (pzbucket = zend_hash_str_find(Z_OBJPROP_P(zobject), "bucket", sizeof("bucket")-1))) { if (NULL == (pzbucket = zend_hash_str_find(Z_OBJPROP_P(zobject), "bucket", sizeof("bucket")-1))) {
zend_value_error("Object has no bucket property"); zend_argument_value_error(2, "must be an object that has a 'bucket' property");
RETURN_THROWS(); RETURN_THROWS();
} }

View file

@ -1240,11 +1240,11 @@ PHP_FUNCTION(unserialize)
max_depth = zend_hash_str_find_deref(Z_ARRVAL_P(options), "max_depth", sizeof("max_depth") - 1); max_depth = zend_hash_str_find_deref(Z_ARRVAL_P(options), "max_depth", sizeof("max_depth") - 1);
if (max_depth) { if (max_depth) {
if (Z_TYPE_P(max_depth) != IS_LONG) { if (Z_TYPE_P(max_depth) != IS_LONG) {
zend_type_error("max_depth should be int"); zend_type_error("unserialize(): 'max_depth' option must be of type int, %s given", zend_zval_type_name(max_depth));
goto cleanup; goto cleanup;
} }
if (Z_LVAL_P(max_depth) < 0) { if (Z_LVAL_P(max_depth) < 0) {
zend_value_error("max_depth cannot be negative"); zend_value_error("unserialize(): 'max_depth' option must be greater than or equal to 0");
goto cleanup; goto cleanup;
} }

View file

@ -108,8 +108,8 @@ bool(false)
bool(false) bool(false)
Error: Error:
Kind must be of type int, string or array PhpToken::is(): Argument #1 ($kind) must be of type string|int|array, float given
Kind array must have elements of type int or string PhpToken::is(): Argument #1 ($kind) must only have elements of type string|int, float given
Typed property PhpToken::$id must not be accessed before initialization Typed property PhpToken::$id must not be accessed before initialization
Typed property PhpToken::$text must not be accessed before initialization Typed property PhpToken::$text must not be accessed before initialization
Typed property PhpToken::$id must not be accessed before initialization Typed property PhpToken::$id must not be accessed before initialization

View file

@ -192,13 +192,13 @@ PHP_METHOD(PhpToken, is)
RETURN_TRUE; RETURN_TRUE;
} }
} else { } else {
zend_type_error("Kind array must have elements of type int or string"); zend_argument_type_error(1, "must only have elements of type string|int, %s given", zend_zval_type_name(entry));
RETURN_THROWS(); RETURN_THROWS();
} }
} ZEND_HASH_FOREACH_END(); } ZEND_HASH_FOREACH_END();
RETURN_FALSE; RETURN_FALSE;
} else { } else {
zend_type_error("Kind must be of type int, string or array"); zend_argument_type_error(1, "must be of type string|int|array, %s given", zend_zval_type_name(kind));
RETURN_THROWS(); RETURN_THROWS();
} }
} }