]> granicus.if.org Git - php/commitdiff
Improve some TypeError and ValueError messages
authorMáté Kocsis <kocsismate@woohoolabs.com>
Mon, 13 Apr 2020 08:41:23 +0000 (10:41 +0200)
committerMáté Kocsis <kocsismate@woohoolabs.com>
Tue, 14 Apr 2020 12:38:45 +0000 (14:38 +0200)
Closes GH-5377

46 files changed:
ext/bz2/bz2.c
ext/bz2/tests/001.phpt
ext/gd/gd.c
ext/gd/libgd/gd.h
ext/iconv/tests/iconv_strpos.phpt
ext/mbstring/mbstring.c
ext/mbstring/tests/bug43840.phpt
ext/mbstring/tests/bug43841.phpt
ext/mbstring/tests/bug45923.phpt
ext/mbstring/tests/mb_stripos_empty_needle.phpt
ext/mbstring/tests/mb_stripos_invalid_offset.phpt
ext/mbstring/tests/mb_stripos_variation5_Bug45923.phpt
ext/mbstring/tests/mb_strpos_empty_needle.phpt
ext/mbstring/tests/mb_strpos_invalid_offset.phpt
ext/mbstring/tests/mb_strpos_offset_errors.phpt
ext/mbstring/tests/mb_strpos_variation5.phpt
ext/mbstring/tests/mb_strripos_empty_needle.phpt
ext/mbstring/tests/mb_strripos_variation5_Bug45923.phpt
ext/mbstring/tests/mb_strrpos_empty_needle.phpt
ext/reflection/php_reflection.c
ext/reflection/tests/ReflectionProperty_getValue_error.phpt
ext/reflection/tests/ReflectionProperty_isInitialized.phpt
ext/standard/array.c
ext/standard/dir.c
ext/standard/string.c
ext/standard/tests/array/array_column_error.phpt
ext/standard/tests/array/count_invalid_mode.phpt
ext/standard/tests/dir/closedir_variation3.phpt
ext/standard/tests/dir/rewinddir_variation3.phpt
ext/standard/tests/serialize/max_depth.phpt
ext/standard/tests/strings/bug40754.phpt
ext/standard/tests/strings/count_chars_basic.phpt
ext/standard/tests/strings/str_repeat.phpt
ext/standard/tests/strings/stripos_error.phpt
ext/standard/tests/strings/stripos_variation11.phpt
ext/standard/tests/strings/stripos_variation7.phpt
ext/standard/tests/strings/strpos.phpt
ext/standard/tests/strings/strripos_offset.phpt
ext/standard/tests/strings/strrpos_negative_offset.phpt
ext/standard/tests/strings/strrpos_offset.phpt
ext/standard/tests/strings/strrpos_variation11.phpt
ext/standard/tests/strings/strrpos_variation7.phpt
ext/standard/user_filters.c
ext/standard/var.c
ext/tokenizer/tests/PhpToken_methods.phpt
ext/tokenizer/tokenizer.c

index 360f9d9c20583715f8c01da3f6de6c462a771b94..ee690dbda3c0c0893290b48239dbd497741b619e 100644 (file)
@@ -345,7 +345,7 @@ PHP_FUNCTION(bzopen)
        }
 
        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();
        }
 
index 081558a7d4d49a59e7467ad91d05f0290e39174a..90547c6642733656784b422545de2d5b4cf5d881 100644 (file)
@@ -37,15 +37,15 @@ var_dump(bzopen($fp, "r"));
 
 ?>
 --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
 bool(false)
 
 Warning: bzopen(): Filename cannot be empty in %s on line %d
 bool(false)
-bzopen(): Argument #2 ($mode) must be a valid mode. Only 'w' and 'r' are supported
-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 either 'r' or 'w'
 
 Warning: bzopen(no_such_file): Failed to open stream: No such file or directory in %s on line %d
 bool(false)
index 157460b50bc5b0592bb8ccc9355408bbc40e1489..80b05ab89ed57f1b81364b2283db70b10d6cdb9e 100644 (file)
@@ -338,7 +338,7 @@ PHP_MINIT_FUNCTION(gd)
        /* GD2 image format types */
        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_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_BOTH", GD_FLIP_BOTH, CONST_CS | CONST_PERSISTENT);
        REGISTER_LONG_CONSTANT("IMG_EFFECT_REPLACE", gdEffectReplace, CONST_CS | CONST_PERSISTENT);
@@ -3536,7 +3536,7 @@ PHP_FUNCTION(imageflip)
                        gdImageFlipVertical(im);
                        break;
 
-               case GD_FLIP_HORINZONTAL:
+               case GD_FLIP_HORIZONTAL:
                        gdImageFlipHorizontal(im);
                        break;
 
@@ -3545,7 +3545,7 @@ PHP_FUNCTION(imageflip)
                        break;
 
                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();
        }
 
index cddd6c1f7a6b81f92addd64d29865dad8e135652..739f844f25d990b4b8d843f1f628843fe77325f9 100644 (file)
@@ -824,7 +824,7 @@ void gdImageFlipHorizontal(gdImagePtr im);
 void gdImageFlipVertical(gdImagePtr im);
 void gdImageFlipBoth(gdImagePtr im);
 
-#define GD_FLIP_HORINZONTAL 1
+#define GD_FLIP_HORIZONTAL 1
 #define GD_FLIP_VERTICAL 2
 #define GD_FLIP_BOTH 3
 
index 860ecfc4713ca5cc646f4c2676fc9376c7c5b159..1dafd6c06b482ca396ec3c2f3ec1431cda5f3be5 100644 (file)
@@ -36,12 +36,12 @@ var_dump(iconv_strpos("string", ""));
 var_dump(iconv_strpos("", "string"));
 
 ?>
---EXPECTF--
+--EXPECT--
 bool(false)
 bool(false)
 int(5)
 int(5)
-Offset not contained in string
+strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 bool(false)
 int(7)
 int(7)
index 74274f4ae4026e46329e54724bf88751d25fbef6..163943cddff6d4e317ce9a6340e0b32359e79947 100644 (file)
@@ -1986,10 +1986,10 @@ static void handle_strpos_error(size_t error) {
                php_error_docref(NULL, E_WARNING, "Conversion error");
                break;
        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;
        default:
-               zend_value_error("Unknown error in mb_strpos");
+               zend_value_error("mb_strpos(): Unknown error");
                break;
        }
 }
index 7a3fd030944eada7f1e5f6634e06f0910a3c3fe6..e225804f8a2c24e00473190a28565a457070269c 100644 (file)
@@ -54,18 +54,18 @@ bool(false)
 
 -- Offset is 22 --
 --Multibyte String:--
-Offset not contained in string
+mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 --ASCII String:--
-Offset not contained in string
+mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 
 -- Offset is 53 --
 --Multibyte String:--
-Offset not contained in string
+mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 --ASCII String:--
-Offset not contained in string
+mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 
 -- Offset is 54 --
 --Multibyte String:--
-Offset not contained in string
+mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 --ASCII String:--
-Offset not contained in string
+mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
index 4a1da505d4e76331b2e4ac6a26fb2ca9b06623de..4297eeac00d6f2d28fd0bf2dec3564eb67bfc45d 100644 (file)
@@ -47,21 +47,21 @@ foreach ($offsets as $i) {
 --EXPECT--
 -- Offset is -25 --
 Multibyte String:
-Offset not contained in string
+mb_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 ASCII String:
 mb_strrpos:
-Offset not contained in string
+mb_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 strrpos:
-Offset not contained in string
+strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 
 -- Offset is -24 --
 Multibyte String:
-Offset not contained in string
+mb_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 ASCII String:
 mb_strrpos:
-Offset not contained in string
+mb_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 strrpos:
-Offset not contained in string
+strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 
 -- Offset is -13 --
 Multibyte String:
index 37d2b13f8bbc38f058b6a1553c16a0210dff82f2..36fdda7c0043c87dd5788eb4d0125e5859e9c4e1 100644 (file)
@@ -44,7 +44,7 @@ bool(false)
 > Offset: 11
 bool(false)
 > Offset: 12
-Offset not contained in string
+strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 > Offset: -1
 bool(false)
 > Offset: -3
@@ -52,7 +52,7 @@ int(8)
 > Offset: -6
 int(8)
 > Offset: -20
-Offset not contained in string
+strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 
 ------- mb_strpos -----------
 
@@ -67,7 +67,7 @@ bool(false)
 > Offset: 11
 bool(false)
 > Offset: 12
-Offset not contained in string
+mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 > Offset: -1
 bool(false)
 > Offset: -3
@@ -75,7 +75,7 @@ int(8)
 > Offset: -6
 int(8)
 > Offset: -20
-Offset not contained in string
+mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 
 ------- stripos -----------
 
@@ -90,7 +90,7 @@ bool(false)
 > Offset: 11
 bool(false)
 > Offset: 12
-Offset not contained in string
+stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 > Offset: -1
 bool(false)
 > Offset: -3
@@ -98,7 +98,7 @@ int(8)
 > Offset: -6
 int(8)
 > Offset: -20
-Offset not contained in string
+stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 
 ------- mb_stripos -----------
 
@@ -113,7 +113,7 @@ bool(false)
 > Offset: 11
 bool(false)
 > Offset: 12
-Offset not contained in string
+mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 > Offset: -1
 bool(false)
 > Offset: -3
@@ -121,7 +121,7 @@ int(8)
 > Offset: -6
 int(8)
 > Offset: -20
-Offset not contained in string
+mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 
 ------- strrpos -----------
 
@@ -136,7 +136,7 @@ bool(false)
 > Offset: 11
 bool(false)
 > Offset: 12
-Offset not contained in string
+strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 > Offset: -1
 int(8)
 > Offset: -3
@@ -144,7 +144,7 @@ int(8)
 > Offset: -6
 int(4)
 > Offset: -20
-Offset not contained in string
+strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 
 ------- mb_strrpos -----------
 
@@ -159,7 +159,7 @@ bool(false)
 > Offset: 11
 bool(false)
 > Offset: 12
-Offset not contained in string
+mb_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 > Offset: -1
 int(8)
 > Offset: -3
@@ -167,7 +167,7 @@ int(8)
 > Offset: -6
 int(4)
 > Offset: -20
-Offset not contained in string
+mb_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 
 ------- strripos -----------
 
@@ -182,7 +182,7 @@ bool(false)
 > Offset: 11
 bool(false)
 > Offset: 12
-Offset not contained in string
+strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 > Offset: -1
 int(8)
 > Offset: -3
@@ -190,7 +190,7 @@ int(8)
 > Offset: -6
 int(4)
 > Offset: -20
-Offset not contained in string
+strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 
 ------- mb_strripos -----------
 
@@ -205,7 +205,7 @@ bool(false)
 > Offset: 11
 bool(false)
 > Offset: 12
-Offset not contained in string
+mb_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 > Offset: -1
 int(8)
 > Offset: -3
@@ -213,4 +213,4 @@ int(8)
 > Offset: -6
 int(4)
 > Offset: -20
-Offset not contained in string
+mb_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
index d991e8bdb5be0f87908096523efc9cfe61ef1701..04e4dcef78a2a889b5e617720dacb85b320db3e6 100644 (file)
@@ -73,10 +73,10 @@ int(2)
 int(5)
 
 -- 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 --
-Offset not contained in string
+mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 
 -- Multi-byte string without offset --
 int(0)
@@ -88,7 +88,7 @@ int(2)
 int(19)
 
 -- 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 --
-Offset not contained in string
+mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
index f4ce16d010f490672cb7311edec6e365bd42ffe4..123634faee0d95084839041799d7f755cd55e9f7 100644 (file)
@@ -81,13 +81,13 @@ try {
 --EXPECT--
 String len: 42
 == INVALID OFFSET ==
-Offset not contained in string
-Offset not contained in string
-Offset not contained in string
-Offset not contained in string
-Offset not contained in string
-Offset not contained in string
-Offset not contained in string
-Offset not contained in string
-Offset not contained in string
-Offset not contained in string
+mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
index b071fdbff3558029ffbd2b3f857014699fa31b23..95db4a2c250becd15142a05d8d6aeecbdd24be3d 100644 (file)
@@ -55,9 +55,9 @@ for ($i = -30; $i <= 60; $i += 10) {
 
 **-- Offset is: -30 --**
 -- ASCII String --
-Offset not contained in string
+mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 --Multibyte String --
-Offset not contained in string
+mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 
 **-- Offset is: -20 --**
 -- ASCII String --
@@ -91,24 +91,24 @@ int(20)
 
 **-- Offset is: 30 --**
 -- ASCII String --
-Offset not contained in string
+mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 --Multibyte String --
-Offset not contained in string
+mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 
 **-- Offset is: 40 --**
 -- ASCII String --
-Offset not contained in string
+mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 --Multibyte String --
-Offset not contained in string
+mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 
 **-- Offset is: 50 --**
 -- ASCII String --
-Offset not contained in string
+mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 --Multibyte String --
-Offset not contained in string
+mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 
 **-- Offset is: 60 --**
 -- ASCII String --
-Offset not contained in string
+mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 --Multibyte String --
-Offset not contained in string
+mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
index da3e984b3ad735f336ffee29db5f9a8fd645fe38..0517281f3fc659c6a5a6a43812cc3b4da05f6716 100644 (file)
@@ -72,10 +72,10 @@ int(2)
 int(5)
 
 -- 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 --
-Offset not contained in string
+mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 
 -- Multi-byte string without offset --
 int(0)
@@ -87,7 +87,7 @@ int(2)
 int(19)
 
 -- 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 --
-Offset not contained in string
+mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
index 3e2ea65e9a5a431f902d9199dfad1c33e8b74325..46485291e63454e044151cac9f45df5a1c014f45 100644 (file)
@@ -81,13 +81,13 @@ try {
 --EXPECT--
 String len: 42
 == INVALID OFFSET ==
-Offset not contained in string
-Offset not contained in string
-Offset not contained in string
-Offset not contained in string
-Offset not contained in string
-Offset not contained in string
-Offset not contained in string
-Offset not contained in string
-Offset not contained in string
-Offset not contained in string
+mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
index 41d7e257d4409a4d9a294a359d99117a4fef37ed..68dc75b338ba26f0b7c1052ca8e450c32c9cb63b 100644 (file)
@@ -46,11 +46,11 @@ try {
 
 ?>
 --EXPECT--
-Offset not contained in string
-Offset not contained in string
-Offset not contained in string
-Offset not contained in string
-Offset not contained in string
-Offset not contained in string
-Offset not contained in string
-Offset not contained in string
+mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+mb_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+mb_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+mb_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+mb_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
index fe7542099a97df9cde6cbec3bbba0d8b42fc46e2..ea2192087a7504c1dc0abed6bc8802b5a48a2a8d 100644 (file)
@@ -55,9 +55,9 @@ for ($i = -30; $i <= 60; $i += 10) {
 
 **-- Offset is: -30 --**
 -- ASCII String --
-Offset not contained in string
+mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 --Multibyte String --
-Offset not contained in string
+mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 
 **-- Offset is: -20 --**
 -- ASCII String --
@@ -91,24 +91,24 @@ int(20)
 
 **-- Offset is: 30 --**
 -- ASCII String --
-Offset not contained in string
+mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 --Multibyte String --
-Offset not contained in string
+mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 
 **-- Offset is: 40 --**
 -- ASCII String --
-Offset not contained in string
+mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 --Multibyte String --
-Offset not contained in string
+mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 
 **-- Offset is: 50 --**
 -- ASCII String --
-Offset not contained in string
+mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 --Multibyte String --
-Offset not contained in string
+mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 
 **-- Offset is: 60 --**
 -- ASCII String --
-Offset not contained in string
+mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 --Multibyte String --
-Offset not contained in string
+mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
index 7d41b05a61e90d52b454613356e1a50a8433c1d1..ebc5e540600354326c02984c58d2f0f66b875e78 100644 (file)
@@ -73,10 +73,10 @@ int(7)
 int(5)
 
 -- 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 --
-Offset not contained in string
+mb_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 
 -- Multi-byte string without offset --
 int(21)
@@ -88,7 +88,7 @@ int(21)
 int(19)
 
 -- 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 --
-Offset not contained in string
+mb_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
index ad20bfe3d90149004d6a297e70980f774d7d4398..4160643ce6416dc69bbb75eabe5e5544c278f72c 100644 (file)
@@ -81,24 +81,24 @@ int(20)
 
 **-- Offset is: 30 --**
 -- ASCII String --
-Offset not contained in string
+mb_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 --Multibyte String --
-Offset not contained in string
+mb_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 
 **-- Offset is: 40 --**
 -- ASCII String --
-Offset not contained in string
+mb_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 --Multibyte String --
-Offset not contained in string
+mb_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 
 **-- Offset is: 50 --**
 -- ASCII String --
-Offset not contained in string
+mb_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 --Multibyte String --
-Offset not contained in string
+mb_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 
 **-- Offset is: 60 --**
 -- ASCII String --
-Offset not contained in string
+mb_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 --Multibyte String --
-Offset not contained in string
+mb_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
index 974c44dac00c120387752baa538c97612d25baa9..6be2773276eb91dd6924663b11e322297b0d8bc7 100644 (file)
@@ -73,10 +73,10 @@ int(7)
 int(5)
 
 -- 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 --
-Offset not contained in string
+mb_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 
 -- Multi-byte string without offset --
 int(21)
@@ -88,7 +88,7 @@ int(21)
 int(19)
 
 -- 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 --
-Offset not contained in string
+mb_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
index 6023ef0c0d8ce9a68551b4d1ae60e4d16e90e7a6..e23f0076a966212a6aa81e98ff258db6a4da6e65 100644 (file)
@@ -5335,7 +5335,7 @@ ZEND_METHOD(ReflectionProperty, getValue)
                zval rv;
 
                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();
                }
 
@@ -5428,7 +5428,7 @@ ZEND_METHOD(ReflectionProperty, isInitialized)
                int retval;
 
                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();
                }
 
index c5da067c32d93d2fa7b6408be49a37144be31fba..40254319cc14f626ab49d872dfbb73cf17ab2e96 100644 (file)
@@ -66,4 +66,4 @@ Invalid instance:
 Given object is not an instance of the class this property was declared in
 
 Missing instance:
-No object provided for getValue() on instance property
+ReflectionProperty::getValue(): Argument #1 ($object) must be provided for instance properties
index 29541e405b1743690e0633ca6c4200e6c9f05d3f..ac87873c6ac99f99611996d81fced2b874c903f8 100644 (file)
@@ -114,7 +114,7 @@ bool(false)
 Object type:
 bool(false)
 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:
 bool(false)
 bool(false)
index daecdc7a52e329fd9ffe200ac3c0bdd3487fb9ff..dd7914f8c78c720dce10afc5954e9a0bb629417a 100644 (file)
@@ -704,7 +704,7 @@ PHP_FUNCTION(count)
        ZEND_PARSE_PARAMETERS_END();
 
        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();
        }
 
@@ -4087,8 +4087,7 @@ PHP_FUNCTION(array_count_values)
  * Specialized conversion rules for array_column() function
  */
 static inline
-zend_bool array_column_param_helper(zval *param,
-                                    const char *name) {
+zend_bool array_column_param_helper(zval *param, int parameter_number) {
        switch (Z_TYPE_P(param)) {
                case IS_DOUBLE:
                        convert_to_long_ex(param);
@@ -4105,7 +4104,7 @@ zend_bool array_column_param_helper(zval *param,
                        return 1;
 
                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;
        }
 }
@@ -4166,9 +4165,9 @@ PHP_FUNCTION(array_column)
                Z_PARAM_ZVAL_EX(index, 1, 0)
        ZEND_PARSE_PARAMETERS_END();
 
-       if ((column && !array_column_param_helper(column, "column")) ||
-           (index && !array_column_param_helper(index, "index"))) {
-               return;
+       if ((column && !array_column_param_helper(column, 2)) ||
+           (index && !array_column_param_helper(index, 3))) {
+               RETURN_THROWS();
        }
 
        array_init_size(return_value, zend_hash_num_elements(input));
index 0b18c1f14627884e29bb431332cfd5e45b4c8f87..da1af5ad74112aea13e577a135498cb5a432cca9 100644 (file)
@@ -254,7 +254,7 @@ PHP_FUNCTION(closedir)
        FETCH_DIRP();
 
        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();
        }
 
@@ -368,7 +368,7 @@ PHP_FUNCTION(rewinddir)
        FETCH_DIRP();
 
        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();
        }
 
index a22992aa817376abe75a52040880789551e3c533..4c0aaad974d484842bc40a7ab22891b1daaf1f0b 100644 (file)
@@ -1889,7 +1889,7 @@ PHP_FUNCTION(strpos)
                offset += (zend_long)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();
        }
 
@@ -1925,7 +1925,7 @@ PHP_FUNCTION(stripos)
                offset += (zend_long)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();
        }
 
@@ -1967,14 +1967,14 @@ PHP_FUNCTION(strrpos)
 
        if (offset >= 0) {
                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();
                }
                p = ZSTR_VAL(haystack) + (size_t)offset;
                e = ZSTR_VAL(haystack) + ZSTR_LEN(haystack);
        } else {
                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();
                }
 
@@ -2017,7 +2017,7 @@ PHP_FUNCTION(strripos)
                char lowered;
                if (offset >= 0) {
                        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();
                        }
                        p = ZSTR_VAL(haystack) + (size_t)offset;
@@ -2025,7 +2025,7 @@ PHP_FUNCTION(strripos)
                } else {
                        p = ZSTR_VAL(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();
                        }
                        e = ZSTR_VAL(haystack) + (ZSTR_LEN(haystack) + (size_t)offset);
@@ -2045,7 +2045,7 @@ PHP_FUNCTION(strripos)
        if (offset >= 0) {
                if ((size_t)offset > ZSTR_LEN(haystack)) {
                        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();
                }
                p = ZSTR_VAL(haystack_dup) + offset;
@@ -2053,7 +2053,7 @@ PHP_FUNCTION(strripos)
        } else {
                if (offset < -ZEND_LONG_MAX || (size_t)(-offset) > ZSTR_LEN(haystack)) {
                        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();
                }
 
@@ -5273,7 +5273,7 @@ PHP_FUNCTION(str_repeat)
        ZEND_PARSE_PARAMETERS_END();
 
        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();
        }
 
@@ -5331,7 +5331,7 @@ PHP_FUNCTION(count_chars)
        ZEND_PARSE_PARAMETERS_END();
 
        if (mymode < 0 || mymode > 4) {
-               zend_value_error("Unknown mode");
+               zend_argument_value_error(2, "must be between 1 and 4 (inclusive)");
                RETURN_THROWS();
        }
 
index 6fb5169d454bd9aec1388f8a3f0e99dca47e5d2f..547ecf91cb354ff50a75d43a7d1452ebde1cc141 100644 (file)
@@ -46,15 +46,15 @@ DONE
 *** Testing array_column() : error conditions ***
 
 -- 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) --
-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) --
-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) --
-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
index a411a2983ed5b72903a543355453bcae0fc62110..4f7950e7271ee4db33f1c57b5b54c62d432bdff8 100644 (file)
@@ -29,9 +29,9 @@ int(0)
 int(0)
 int(0)
 int(0)
-count(): Argument #2 ($mode) must be a valid mode
-count(): Argument #2 ($mode) must be a valid mode
-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 either COUNT_NORMAL or COUNT_RECURSIVE
+count(): Argument #2 ($mode) must be either COUNT_NORMAL or COUNT_RECURSIVE
 int(0)
 int(0)
 int(0)
index 1d9c644a3e652ce45c205af8c4ab6e8429f9f23d..0f50c1db03716db232137aaf3232a5c136718dbf 100644 (file)
@@ -37,7 +37,7 @@ if(is_resource($fp)) {
 resource(%d) of type (stream)
 
 -- 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: --
 resource(%d) of type (stream)
index 07508eac3f7ab18c73e2baffde8ddb5d115f23cc..7619f82ecff7d432c4a007d601659a0f0b70a540 100644 (file)
@@ -38,7 +38,7 @@ if ($result1 === $result2) {
 
 -- Open a file using fopen --
 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 --
 rewinddir() does not work on file pointers
index 5e1c869b1d25ee4c883d08f41fb4eaab4d1cb21a..79ab13e9f1658459792d5954452af361f6566506 100644 (file)
@@ -104,8 +104,8 @@ var_dump(is_array(unserialize(
 ?>
 --EXPECTF--
 Invalid max_depth:
-max_depth should be int
-max_depth cannot be negative
+unserialize(): 'max_depth' option must be of type int, string given
+unserialize(): 'max_depth' option must be greater than or equal to 0
 Array:
 bool(true)
 
index 5f35b4da444294c9f73c43291ea703635947900d..b71f28044aefd6d15bba100ab0f68c2d0c4f3c8c 100644 (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
 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)
 
 Warning: substr_count(): Invalid length value in %s on line %d
 bool(false)
-Offset not contained in string
-Offset not contained in string
-Offset not contained in string
-Offset not contained in string
+strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 int(2)
 string(8) "abcdeabc"
 bool(false)
index c1868714b06e695eacf80c3f12d41ba30bc489f7..0e5c3455e8cb9480c9853670b52aac41f188fbd1 100644 (file)
@@ -1575,4 +1575,4 @@ array(238) {
 }
 string(18) " Rabcdefghimnorstu"
 string(476) "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f2122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f5051535455565758595a5b5c5d5e5f606a6b6c7071767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff"
-Unknown mode
+count_chars(): Argument #2 ($mode) must be between 1 and 4 (inclusive)
index 4751dc783ffc1d72d635fb0324a43c99d7b385ba..73a17818efd9172e9b542b718aded5aff0784594 100644 (file)
Binary files a/ext/standard/tests/strings/str_repeat.phpt and b/ext/standard/tests/strings/str_repeat.phpt differ
index caa93298748abc496f83ffdf9528195e5e1339a0..57ad35135f0efc1717cfd6140854162dd508e0de 100644 (file)
@@ -29,8 +29,8 @@ echo "*** Done ***";
 *** Testing stripos() function: error conditions ***
 
 -- 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 not contained in string
+stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 *** Done ***
index 9b7ff243503300be8fbae018a99b148f8e9589b9..b1e72e3e4c7fc8134b84305b06cb5b58eb57d98b 100644 (file)
@@ -145,35 +145,35 @@ int(0)
 bool(false)
 -- Iteration 16 --
 int(0)
-ValueError: Offset not contained in string
+ValueError: stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 -- Iteration 17 --
 int(0)
 bool(false)
 -- Iteration 18 --
 int(0)
-ValueError: Offset not contained in string
+ValueError: stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 -- Iteration 19 --
 int(0)
 bool(false)
 -- Iteration 20 --
 int(0)
-ValueError: Offset not contained in string
+ValueError: stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 -- Iteration 21 --
 int(0)
-ValueError: Offset not contained in string
+ValueError: stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 -- Iteration 22 --
 int(0)
-ValueError: Offset not contained in string
+ValueError: stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 -- Iteration 23 --
 int(0)
-ValueError: Offset not contained in string
+ValueError: stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 -- 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
 -- Iteration 25 --
 int(0)
-ValueError: Offset not contained in string
+ValueError: stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 -- Iteration 26 --
 int(0)
-ValueError: Offset not contained in string
+ValueError: stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 *** Done ***
index d2ac6551dbe1d18465f6083d96ac02ec689727cc..f6b123997314e8a1e947d0a24593559b338b11aa 100644 (file)
@@ -31,7 +31,7 @@ echo "*** Done ***";
 *** Testing stripos() function: with heredoc strings ***
 -- With empty heredoc string --
 int(0)
-Offset not contained in string
+stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 int(0)
 int(0)
 *** Done ***
index 2d44cd921291745a320822c1dbb3843be31a3ba5..1c9045b76a4bf30fb30dfc6b7f4d24bea217f5a3 100644 (file)
Binary files a/ext/standard/tests/strings/strpos.phpt and b/ext/standard/tests/strings/strpos.phpt differ
index 39d0bf16f813ed2fc070881821fc6158ffb400a3..59b5374caec790c983ce5fc7620b1b4db4f45e3e 100644 (file)
@@ -37,8 +37,8 @@ echo "Done\n";
 ?>
 --EXPECT--
 strripos(): Argument #3 ($offset) must be of type int, float given
-Offset not contained in string
-Offset not contained in string
-Offset not contained in string
-Offset not contained in string
+strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 Done
index 41b2b16b569174d0200d6d3e23640a5e8c006c3a..e4ac469ba4b813bb61bd29e5869791b4c662bd74 100644 (file)
@@ -32,11 +32,11 @@ int(7)
 bool(false)
 int(5)
 int(1)
-Offset not contained in string
+strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 int(0)
 int(0)
 int(7)
 bool(false)
 int(5)
 int(1)
-Offset not contained in string
+strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
index 13df98e71c8ea75f49334d7552f214358d7ef94a..46b37955e4ab8b47651d13485a4e190831611207 100644 (file)
@@ -37,8 +37,8 @@ echo "Done\n";
 ?>
 --EXPECT--
 strrpos(): Argument #3 ($offset) must be of type int, float given
-Offset not contained in string
-Offset not contained in string
-Offset not contained in string
-Offset not contained in string
+strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 Done
index df0aac0153a3fb191e38c957b913bc0c25048488..185af4e1547a7a82be8063d55f80830c210c0780 100644 (file)
@@ -146,35 +146,35 @@ int(0)
 bool(false)
 -- Iteration 16 --
 int(0)
-ValueError: Offset not contained in string
+ValueError: strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 -- Iteration 17 --
 int(0)
 bool(false)
 -- Iteration 18 --
 int(0)
-ValueError: Offset not contained in string
+ValueError: strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 -- Iteration 19 --
 int(0)
 bool(false)
 -- Iteration 20 --
 int(0)
-ValueError: Offset not contained in string
+ValueError: strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 -- Iteration 21 --
 int(0)
-ValueError: Offset not contained in string
+ValueError: strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 -- Iteration 22 --
 int(0)
-ValueError: Offset not contained in string
+ValueError: strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 -- Iteration 23 --
 int(0)
-ValueError: Offset not contained in string
+ValueError: strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 -- 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
 -- Iteration 25 --
 int(0)
-ValueError: Offset not contained in string
+ValueError: strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 -- Iteration 26 --
 int(0)
-ValueError: Offset not contained in string
+ValueError: strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 *** Done ***
index 9a02a4a0ec00fb9343408745ab730c919c79e86f..79715453c9ef7ef941f9f8de5860f81cf568c595 100644 (file)
@@ -30,7 +30,7 @@ echo "*** Done ***";
 *** Testing strrpos() function: with heredoc strings ***
 -- With empty heredoc string --
 int(0)
-Offset not contained in string
+strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
 int(0)
 int(0)
 *** Done ***
index fc8fd826c8f6bda887be0af3f7599df4b4cd7eb1..4d11ae2b4410ed9f4113b2d48f00998e7ddda312 100644 (file)
@@ -416,7 +416,7 @@ static void php_stream_bucket_attach(int append, INTERNAL_FUNCTION_PARAMETERS)
        ZEND_PARSE_PARAMETERS_END();
 
        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();
        }
 
index dc133dd5ce5eb79a75e06597cbc46ffd032611a7..e1bc4c5597f40cf1c052e89c18d28693b00541a3 100644 (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);
                if (max_depth) {
                        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;
                        }
                        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;
                        }
 
index 9429cea7ed9c2153e914db3ffaa61c7572881ed0..3e08f3c39e1553e021ecbdfb883421b31e08ca5f 100644 (file)
@@ -108,8 +108,8 @@ bool(false)
 bool(false)
 
 Error:
-Kind must be of type int, string or array
-Kind array must have elements of type int or string
+PhpToken::is(): Argument #1 ($kind) must be of type string|int|array, float given
+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::$text must not be accessed before initialization
 Typed property PhpToken::$id must not be accessed before initialization
index f07a839bb61d8717c90f10872875f9d6ebe07432..db573232233a9862dca7988847ba3252fc79a4a7 100644 (file)
@@ -192,13 +192,13 @@ PHP_METHOD(PhpToken, is)
                                        RETURN_TRUE;
                                }
                        } 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();
                        }
                } ZEND_HASH_FOREACH_END();
                RETURN_FALSE;
        } 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();
        }
 }