php_stream_from_zval(stream, bz);
if (len < 0) {
- zend_value_error("Length cannot be negative");
+ zend_argument_value_error(2, "must be greater than or equal to 0");
RETURN_THROWS();
}
}
if (mode_len != 1 || (mode[0] != 'r' && mode[0] != 'w')) {
- zend_value_error("'%s' is not a valid mode for bzopen(). Only 'w' and 'r' are supported.", mode);
+ zend_argument_value_error(2, "must be a valid mode. Only 'w' and 'r' are supported");
RETURN_THROWS();
}
?>
--EXPECTF--
-'' is not a valid mode for bzopen(). Only 'w' and 'r' are supported.
+bzopen(): Argument #2 ($mode) must be a valid mode. Only 'w' and 'r' are supported
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)
-'x' is not a valid mode for bzopen(). Only 'w' and 'r' are supported.
-'rw' is not a valid mode for bzopen(). 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 a valid mode. Only 'w' and 'r' are supported
Warning: bzopen(no_such_file): Failed to open stream: No such file or directory in %s on line %d
bool(false)
?>
--EXPECT--
string(0) ""
-Length cannot be negative
+bzread(): Argument #2 ($length) must be greater than or equal to 0
string(1) "R"
string(2) "is"
string(251) "ing up from the heart of the desert
?>
--EXPECT--
string(0) ""
-Length cannot be negative
+bzread(): Argument #2 ($length) must be greater than or equal to 0
string(1) "R"
string(2) "is"
string(251) "ing up from the heart of the desert
if (!ts) {
ts = time(NULL);
} else if (ts < 0) {
- zend_value_error("Timestamp must not be negative");
+ zend_argument_value_error(1, "must be greater than or equal to 0");
RETURN_THROWS();
}
if (cal != -1 && (cal < 0 || cal >= CAL_NUM_CALS)) {
- zend_value_error("Invalid calendar ID: " ZEND_LONG_FMT, cal);
+ zend_argument_value_error(1, "must be a valid calendar ID");
RETURN_THROWS();
}
}
if (cal < 0 || cal >= CAL_NUM_CALS) {
- zend_value_error("Invalid calendar ID: " ZEND_LONG_FMT, cal);
+ zend_argument_value_error(1, "must be a valid calendar ID");
RETURN_THROWS();
}
}
if (cal < 0 || cal >= CAL_NUM_CALS) {
- zend_value_error("Invalid calendar ID: " ZEND_LONG_FMT, cal);
+ zend_argument_value_error(1, "must be a valid calendar ID");
RETURN_THROWS();
}
}
if (cal < 0 || cal >= CAL_NUM_CALS) {
- zend_value_error("Invalid calendar ID: " ZEND_LONG_FMT, cal);
+ zend_argument_value_error(2, "must be a valid calendar ID");
RETURN_THROWS();
}
calendar = &cal_conversion_table[cal];
}
if (gm && (year<1970 || year>2037)) { /* out of range for timestamps */
- zend_value_error("This function is only valid for years between 1970 and 2037 inclusive");
+ zend_argument_value_error(1, "must be between 1970 and 2037 (inclusive)");
RETURN_THROWS();
}
}
?>
--EXPECT--
-Invalid calendar ID: -1
+cal_days_in_month(): Argument #1 ($calendar) must be a valid calendar ID
Invalid date
}
?>
--EXPECT--
-Invalid calendar ID: -1
+cal_from_jd(): Argument #2 ($calendar) must be a valid calendar ID
[calname] => Julian
[calsymbol] => CAL_JULIAN
)
-Invalid calendar ID: 99999
+cal_info(): Argument #1 ($calendar) must be a valid calendar ID
}
?>
--EXPECT--
-Invalid calendar ID: -1
+cal_to_jd(): Argument #1 ($calendar) must be a valid calendar ID
2000-04-23
2001-04-15
2002-03-31
-This function is only valid for years between 1970 and 2037 inclusive
+easter_date(): Argument #1 ($year) must be between 1970 and 2037 (inclusive)
var_dump(unixtojd(time())) . PHP_EOL;
?>
--EXPECTF--
-Timestamp must not be negative
+unixtojd(): Argument #1 ($timestamp) must be greater than or equal to 0
int(%d)
int(%d)
int(%d)
num_styles = zend_hash_num_elements(Z_ARRVAL_P(styles));
if (num_styles == 0) {
- zend_value_error("Styles array must not be empty");
+ zend_argument_value_error(2, "cannot be empty");
RETURN_THROWS();
}
}
if (x_size <= 0 || x_size >= INT_MAX) {
- zend_value_error("Invalid width (x_size)");
+ zend_argument_value_error(1, "must be greater than 0");
RETURN_THROWS();
}
if (y_size <= 0 || y_size >= INT_MAX) {
- zend_value_error("Invalid height (y_size)");
+ zend_argument_value_error(2, "must be greater than 0");
RETURN_THROWS();
}
im = php_gd_libgdimageptr_from_zval_p(IM);
if (ncolors <= 0 || ZEND_LONG_INT_OVFL(ncolors)) {
- zend_value_error("Number of colors has to be greater than zero and no more than %d", INT_MAX);
+ zend_argument_value_error(3, "must be greater than 0 and less than %d", INT_MAX);
RETURN_THROWS();
}
}
/* }}} */
-#define CHECK_RGBA_RANGE(component, name) \
+#define CHECK_RGBA_RANGE(component, name, argument_number) \
if (component < 0 || component > gd##name##Max) { \
- zend_value_error(#name " component is out of range, must be between 0 and %d (inclusive)", gd##name##Max); \
+ zend_argument_value_error(argument_number, "must be between 0 and %d (inclusive)", gd##name##Max); \
RETURN_THROWS(); \
}
im = php_gd_libgdimageptr_from_zval_p(IM);
- CHECK_RGBA_RANGE(red, Red);
- CHECK_RGBA_RANGE(green, Green);
- CHECK_RGBA_RANGE(blue, Blue);
- CHECK_RGBA_RANGE(alpha, Alpha);
+ CHECK_RGBA_RANGE(red, Red, 2);
+ CHECK_RGBA_RANGE(green, Green, 3);
+ CHECK_RGBA_RANGE(blue, Blue, 4);
+ CHECK_RGBA_RANGE(alpha, Alpha, 5);
ct = gdImageColorAllocateAlpha(im, red, green, blue, alpha);
if (ct < 0) {
im = php_gd_libgdimageptr_from_zval_p(IM);
- CHECK_RGBA_RANGE(red, Red);
- CHECK_RGBA_RANGE(green, Green);
- CHECK_RGBA_RANGE(blue, Blue);
- CHECK_RGBA_RANGE(alpha, Alpha);
+ CHECK_RGBA_RANGE(red, Red, 2);
+ CHECK_RGBA_RANGE(green, Green, 3);
+ CHECK_RGBA_RANGE(blue, Blue, 4);
+ CHECK_RGBA_RANGE(alpha, Alpha, 5);
RETURN_LONG(gdImageColorResolveAlpha(im, red, green, blue, alpha));
}
im = php_gd_libgdimageptr_from_zval_p(IM);
- CHECK_RGBA_RANGE(red, Red);
- CHECK_RGBA_RANGE(green, Green);
- CHECK_RGBA_RANGE(blue, Blue);
- CHECK_RGBA_RANGE(alpha, Alpha);
+ CHECK_RGBA_RANGE(red, Red, 2);
+ CHECK_RGBA_RANGE(green, Green, 3);
+ CHECK_RGBA_RANGE(blue, Blue, 4);
+ CHECK_RGBA_RANGE(alpha, Alpha, 5);
RETURN_LONG(gdImageColorClosestAlpha(im, red, green, blue, alpha));
}
zend_long red, green, blue, alpha;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "Ollll", &IM, gd_image_ce, &red, &green, &blue, &alpha) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "Ollll", &IM, gd_image_ce, &red, &green, &blue, &alpha) == FAILURE) {
RETURN_THROWS();
}
im = php_gd_libgdimageptr_from_zval_p(IM);
- CHECK_RGBA_RANGE(red, Red);
- CHECK_RGBA_RANGE(green, Green);
- CHECK_RGBA_RANGE(blue, Blue);
- CHECK_RGBA_RANGE(alpha, Alpha);
+ CHECK_RGBA_RANGE(red, Red, 2);
+ CHECK_RGBA_RANGE(green, Green, 3);
+ CHECK_RGBA_RANGE(blue, Blue, 4);
+ CHECK_RGBA_RANGE(alpha, Alpha, 5);
RETURN_LONG(gdImageColorExactAlpha(im, red, green, blue, alpha));
}
}
if (x_size <= 0 || x_size >= INT_MAX) {
- zend_value_error("Invalid width (x_size)");
+ zend_argument_value_error(1, "must be greater than 0");
RETURN_THROWS();
}
if (y_size <= 0 || y_size >= INT_MAX) {
- zend_value_error("Invalid height (y_size)");
+ zend_argument_value_error(2, "must be greater than 0");
RETURN_THROWS();
}
}
if (width < 1) {
- zend_value_error("Width must be at least 1");
+ zend_argument_value_error(4, "must be greater than or equal to 1");
RETURN_THROWS();
}
if (height < 1) {
- zend_value_error("Height must be at least 1");
+ zend_argument_value_error(5, "must be greater than or equal to 1");
RETURN_THROWS();
}
im = php_gd_libgdimageptr_from_zval_p(IM);
- CHECK_RGBA_RANGE(red, Red);
- CHECK_RGBA_RANGE(green, Green);
- CHECK_RGBA_RANGE(blue, Blue);
+ CHECK_RGBA_RANGE(red, Red, 2);
+ CHECK_RGBA_RANGE(green, Green, 3);
+ CHECK_RGBA_RANGE(blue, Blue, 4);
ct = gdImageColorAllocate(im, red, green, blue);
if (ct < 0) {
im = php_gd_libgdimageptr_from_zval_p(IM);
- CHECK_RGBA_RANGE(red, Red);
- CHECK_RGBA_RANGE(green, Green);
- CHECK_RGBA_RANGE(blue, Blue);
+ CHECK_RGBA_RANGE(red, Red, 2);
+ CHECK_RGBA_RANGE(green, Green, 3);
+ CHECK_RGBA_RANGE(blue, Blue, 4);
RETURN_LONG(gdImageColorClosest(im, red, green, blue));
}
im = php_gd_libgdimageptr_from_zval_p(IM);
- CHECK_RGBA_RANGE(red, Red);
- CHECK_RGBA_RANGE(green, Green);
- CHECK_RGBA_RANGE(blue, Blue);
+ CHECK_RGBA_RANGE(red, Red, 2);
+ CHECK_RGBA_RANGE(green, Green, 3);
+ CHECK_RGBA_RANGE(blue, Blue, 4);
RETURN_LONG(gdImageColorClosestHWB(im, red, green, blue));
}
gdImageColorDeallocate(im, col);
RETURN_TRUE;
} else {
- zend_value_error("Color index %d out of range", col);
+ zend_argument_value_error(2, "must be between 0 and %d", gdImageColorsTotal(im));
RETURN_THROWS();
}
}
im = php_gd_libgdimageptr_from_zval_p(IM);
- CHECK_RGBA_RANGE(red, Red);
- CHECK_RGBA_RANGE(green, Green);
- CHECK_RGBA_RANGE(blue, Blue);
+ CHECK_RGBA_RANGE(red, Red, 2);
+ CHECK_RGBA_RANGE(green, Green, 3);
+ CHECK_RGBA_RANGE(blue, Blue, 4);
RETURN_LONG(gdImageColorResolve(im, red, green, blue));
}
im = php_gd_libgdimageptr_from_zval_p(IM);
- CHECK_RGBA_RANGE(red, Red);
- CHECK_RGBA_RANGE(green, Green);
- CHECK_RGBA_RANGE(blue, Blue);
+ CHECK_RGBA_RANGE(red, Red, 2);
+ CHECK_RGBA_RANGE(green, Green, 3);
+ CHECK_RGBA_RANGE(blue, Blue, 4);
RETURN_LONG(gdImageColorExact(im, red, green, blue));
}
im = php_gd_libgdimageptr_from_zval_p(IM);
- CHECK_RGBA_RANGE(red, Red);
- CHECK_RGBA_RANGE(green, Green);
- CHECK_RGBA_RANGE(blue, Blue);
- CHECK_RGBA_RANGE(alpha, Alpha);
+ CHECK_RGBA_RANGE(red, Red, 2);
+ CHECK_RGBA_RANGE(green, Green, 3);
+ CHECK_RGBA_RANGE(blue, Blue, 4);
col = color;
RETURN_THROWS();
}
- if ( input <= 0.0 || output <= 0.0 ) {
- zend_value_error("Gamma values must be positive");
+ if (input <= 0.0) {
+ zend_argument_value_error(2, "must be greater than 0");
+ RETURN_THROWS();
+ }
+
+ if (output <= 0.0) {
+ zend_argument_value_error(3, "must be greater than 0");
RETURN_THROWS();
}
COL = NPOINTS;
NPOINTS = zend_hash_num_elements(Z_ARRVAL_P(POINTS));
if (NPOINTS % 2 != 0) {
- zend_value_error("Points array must have an even number of elements");
+ zend_argument_value_error(2, "must have an even number of elements");
RETURN_THROWS();
}
NPOINTS /= 2;
nelem = zend_hash_num_elements(Z_ARRVAL_P(POINTS));
if (npoints < 3) {
- zend_value_error("Polygon must have at least 3 points");
+ zend_argument_value_error(3, "must be greater than or equal to 3");
RETURN_THROWS();
}
dstH = DH;
dstW = DW;
- if (dstW <= 0 || dstH <= 0 || srcW <= 0 || srcH <= 0) {
- zend_value_error("Invalid image dimensions");
+ if (dstW <= 0) {
+ zend_argument_value_error(3, "must be greater than 0");
+ RETURN_THROWS();
+ }
+
+ if (dstH <= 0) {
+ zend_argument_value_error(4, "must be greater than 0");
+ RETURN_THROWS();
+ }
+
+ if (srcW <= 0) {
+ zend_argument_value_error(5, "must be greater than 0");
+ RETURN_THROWS();
+ }
+
+ if (srcH <= 0) {
+ zend_argument_value_error(6, "must be greater than 0");
RETURN_THROWS();
}
nelem = zend_hash_num_elements(Z_ARRVAL_P(hash_matrix));
if (nelem != 3) {
- zend_value_error("Convolution matrix must be a 3x3 array");
+ zend_argument_value_error(2, "must be a 3x3 array");
RETURN_THROWS();
}
for (i=0; i<3; i++) {
if ((var = zend_hash_index_find(Z_ARRVAL_P(hash_matrix), (i))) != NULL && Z_TYPE_P(var) == IS_ARRAY) {
if (zend_hash_num_elements(Z_ARRVAL_P(var)) != 3 ) {
- zend_value_error("Convolution matrix must be a 3x3 array, matrix[%d] only has %d elements", i, zend_hash_num_elements(Z_ARRVAL_P(var)));
+ zend_argument_value_error(2, "must be a 3x3 array, matrix[%d] only has %d elements", i, zend_hash_num_elements(Z_ARRVAL_P(var)));
RETURN_THROWS();
}
if ((var2 = zend_hash_index_find(Z_ARRVAL_P(var), j)) != NULL) {
matrix[i][j] = (float) zval_get_double(var2);
} else {
- zend_value_error("Convolution matrix must be a 3x3 array, matrix[%d][%d] cannot be found (missing integer key)", i, j);
+ zend_argument_value_error(2, "must be a 3x3 array, matrix[%d][%d] cannot be found (missing integer key)", i, j);
RETURN_THROWS();
}
}
break;
default:
- zend_value_error("Unknown flip mode");
+ zend_argument_value_error(2, "must be a valid mode");
RETURN_THROWS();
}
if ((tmp = zend_hash_str_find(Z_ARRVAL_P(z_rect), "x", sizeof("x") -1)) != NULL) {
rect.x = zval_get_long(tmp);
} else {
- zend_value_error("Cropping rectangle is missing x position");
+ zend_argument_value_error(2, "must have an 'x' key");
RETURN_THROWS();
}
if ((tmp = zend_hash_str_find(Z_ARRVAL_P(z_rect), "y", sizeof("y") - 1)) != NULL) {
rect.y = zval_get_long(tmp);
} else {
- zend_value_error("Cropping rectangle is missing y position");
+ zend_argument_value_error(2, "must have a 'y' key");
RETURN_THROWS();
}
if ((tmp = zend_hash_str_find(Z_ARRVAL_P(z_rect), "width", sizeof("width") - 1)) != NULL) {
rect.width = zval_get_long(tmp);
} else {
- zend_value_error("Cropping rectangle is missing width");
+ zend_argument_value_error(2, "must have a 'width' key");
RETURN_THROWS();
}
if ((tmp = zend_hash_str_find(Z_ARRVAL_P(z_rect), "height", sizeof("height") - 1)) != NULL) {
rect.height = zval_get_long(tmp);
} else {
- zend_value_error("Cropping rectangle is missing height");
+ zend_argument_value_error(2, "must have a 'height' key");
RETURN_THROWS();
}
case GD_CROP_THRESHOLD:
if (color < 0 || (!gdImageTrueColor(im) && color >= gdImageColorsTotal(im))) {
- zend_value_error("Color argument missing with threshold mode");
+ zend_argument_value_error(4, "must be greater than or equal to 0 when using the threshold mode");
RETURN_THROWS();
}
im_crop = gdImageCropThreshold(im, color, (float) threshold);
break;
default:
- zend_value_error("Unknown crop mode");
+ zend_argument_value_error(2, "must be a valid mode");
RETURN_THROWS();
}
if ((tmp = zend_hash_str_find(Z_ARRVAL_P(z_rect), "x", sizeof("x") - 1)) != NULL) {
rect.x = zval_get_long(tmp);
} else {
- zend_value_error("Clip array is missing x position");
+ zend_argument_value_error(3, "must have an 'x' key");
RETURN_THROWS();
}
if ((tmp = zend_hash_str_find(Z_ARRVAL_P(z_rect), "y", sizeof("y") - 1)) != NULL) {
rect.y = zval_get_long(tmp);
} else {
- zend_value_error("Clip array is missing y position");
+ zend_argument_value_error(3, "must have a 'y' key");
RETURN_THROWS();
}
if ((tmp = zend_hash_str_find(Z_ARRVAL_P(z_rect), "width", sizeof("width") - 1)) != NULL) {
rect.width = zval_get_long(tmp);
} else {
- zend_value_error("Clip array is missing width");
+ zend_argument_value_error(3, "must have a 'width' key");
RETURN_THROWS();
}
if ((tmp = zend_hash_str_find(Z_ARRVAL_P(z_rect), "height", sizeof("height") - 1)) != NULL) {
rect.height = zval_get_long(tmp);
} else {
- zend_value_error("Clip array is missing height");
+ zend_argument_value_error(3, "must have a 'height' key");
RETURN_THROWS();
}
pRect = ▭
if ((tmp = zend_hash_str_find(Z_ARRVAL_P(options), "x", sizeof("x") - 1)) != NULL) {
x = zval_get_double(tmp);
} else {
- zend_value_error("Options array is missing x position");
+ zend_argument_value_error(2, "must have an 'x' key");
RETURN_THROWS();
}
if ((tmp = zend_hash_str_find(Z_ARRVAL_P(options), "y", sizeof("y") - 1)) != NULL) {
y = zval_get_double(tmp);
} else {
- zend_value_error("Options array is missing y position");
+ zend_argument_value_error(2, "must have a 'y' key");
RETURN_THROWS();
}
zval *tmp;
zval *z_m1;
zval *z_m2;
- int i, nelems;
+ int i;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "aa", &z_m1, &z_m2) == FAILURE) {
RETURN_THROWS();
}
- if (((nelems = zend_hash_num_elements(Z_ARRVAL_P(z_m1))) != 6) || (nelems = zend_hash_num_elements(Z_ARRVAL_P(z_m2))) != 6) {
- zend_value_error("Affine arrays must have six elements");
+ if (zend_hash_num_elements(Z_ARRVAL_P(z_m1)) != 6) {
+ zend_argument_value_error(1, "must have 6 elements");
+ RETURN_THROWS();
+ }
+
+ if (zend_hash_num_elements(Z_ARRVAL_P(z_m2)) != 6) {
+ zend_argument_value_error(1, "must have 6 elements");
RETURN_THROWS();
}
unlink($file);
?>
--EXPECT--
-!! [ValueError] Width must be at least 1
-!! [ValueError] Height must be at least 1
+!! [ValueError] imagecreatefromgd2part(): Argument #4 ($width) must be greater than or equal to 1
+!! [ValueError] imagecreatefromgd2part(): Argument #5 ($height) must be greater than or equal to 1
unlink($file);
?>
--EXPECT--
-!! [ValueError] Width must be at least 1
-!! [ValueError] Height must be at least 1
+!! [ValueError] imagecreatefromgd2part(): Argument #4 ($width) must be greater than or equal to 1
+!! [ValueError] imagecreatefromgd2part(): Argument #5 ($height) must be greater than or equal to 1
---TEST--\r
-Bug #55005 (imagepolygon num_points requirement)\r
---SKIPIF--\r
-<?php\r
-if (!extension_loaded('gd')) die('skip gd extension not available');\r
-?>\r
---FILE--\r
-<?php\r
-require_once __DIR__ . '/func.inc';\r
-\r
-$g = imagecreate(300, 300);\r
-$bgnd = imagecolorallocate($g, 255, 255, 255);\r
-$fgnd = imagecolorallocate($g, 0, 0, 0);\r
-trycatch_dump(\r
- fn () => imagefilledpolygon($g, array(100,10, 100,100, 180,100), 2, $fgnd),\r
- fn () => imagepolygon($g, array(200,10, 200,100, 280,100), 2, $fgnd)\r
-);\r
-?>\r
---EXPECTF--\r
-!! [ValueError] Polygon must have at least 3 points\r
-!! [ValueError] Polygon must have at least 3 points\r
+--TEST--
+Bug #55005 (imagepolygon num_points requirement)
+--SKIPIF--
+<?php
+if (!extension_loaded('gd')) die('skip gd extension not available');
+?>
+--FILE--
+<?php
+require_once __DIR__ . '/func.inc';
+
+$g = imagecreate(300, 300);
+$bgnd = imagecolorallocate($g, 255, 255, 255);
+$fgnd = imagecolorallocate($g, 0, 0, 0);
+trycatch_dump(
+ fn () => imagefilledpolygon($g, array(100,10, 100,100, 180,100), 2, $fgnd),
+ fn () => imagepolygon($g, array(200,10, 200,100, 280,100), 2, $fgnd)
+);
+?>
+--EXPECTF--
+!! [ValueError] imagefilledpolygon(): Argument #3 ($num_points_or_col) must be greater than or equal to 3
+!! [ValueError] imagepolygon(): Argument #3 ($num_points_or_col) must be greater than or equal to 3
?>
--EXPECT--
-!! [ValueError] Color argument missing with threshold mode
+!! [ValueError] imagecropauto(): Argument #4 ($color) must be greater than or equal to 0 when using the threshold mode
?>
DONE
--EXPECT--
-!! [ValueError] Number of colors has to be greater than zero and no more than 2147483647
+!! [ValueError] imagetruecolortopalette(): Argument #3 ($colorWanted) must be greater than 0 and less than 2147483647
DONE
?>
====DONE====
--EXPECT--
-Styles array must not be empty
+imagesetstyle(): Argument #2 ($styles) cannot be empty
====DONE====
?>
--EXPECT--
-!! [ValueError] Gamma values must be positive
+!! [ValueError] imagegammacorrect(): Argument #2 ($inputgamma) must be greater than 0
int(657930)
--Octal -012--
-!! [ValueError] Red component is out of range, must be between 0 and 255 (inclusive)
-!! [ValueError] Green component is out of range, must be between 0 and 255 (inclusive)
-!! [ValueError] Blue component is out of range, must be between 0 and 255 (inclusive)
+!! [ValueError] imagecolorallocate(): Argument #2 ($red) must be between 0 and 255 (inclusive)
+!! [ValueError] imagecolorallocate(): Argument #3 ($green) must be between 0 and 255 (inclusive)
+!! [ValueError] imagecolorallocate(): Argument #4 ($blue) must be between 0 and 255 (inclusive)
--Octal 0377--
int(16714250)
int(657930)
--Hexa-decimal -0xA--
-!! [ValueError] Red component is out of range, must be between 0 and 255 (inclusive)
-!! [ValueError] Green component is out of range, must be between 0 and 255 (inclusive)
-!! [ValueError] Blue component is out of range, must be between 0 and 255 (inclusive)
+!! [ValueError] imagecolorallocate(): Argument #2 ($red) must be between 0 and 255 (inclusive)
+!! [ValueError] imagecolorallocate(): Argument #3 ($green) must be between 0 and 255 (inclusive)
+!! [ValueError] imagecolorallocate(): Argument #4 ($blue) must be between 0 and 255 (inclusive)
--Hexa-decimal 0xFF--
int(16714250)
*** Testing imagecolorallocate() : usage variations ***
--Decimal 256--
-!! [ValueError] Red component is out of range, must be between 0 and 255 (inclusive)
-!! [ValueError] Red component is out of range, must be between 0 and 255 (inclusive)
-!! [ValueError] Green component is out of range, must be between 0 and 255 (inclusive)
-!! [ValueError] Green component is out of range, must be between 0 and 255 (inclusive)
-!! [ValueError] Blue component is out of range, must be between 0 and 255 (inclusive)
-!! [ValueError] Blue component is out of range, must be between 0 and 255 (inclusive)
+!! [ValueError] imagecolorallocate(): Argument #2 ($red) must be between 0 and 255 (inclusive)
+!! [ValueError] imagecolorallocate(): Argument #2 ($red) must be between 0 and 255 (inclusive)
+!! [ValueError] imagecolorallocate(): Argument #3 ($green) must be between 0 and 255 (inclusive)
+!! [ValueError] imagecolorallocate(): Argument #3 ($green) must be between 0 and 255 (inclusive)
+!! [ValueError] imagecolorallocate(): Argument #4 ($blue) must be between 0 and 255 (inclusive)
+!! [ValueError] imagecolorallocate(): Argument #4 ($blue) must be between 0 and 255 (inclusive)
--Octal 0400--
-!! [ValueError] Red component is out of range, must be between 0 and 255 (inclusive)
-!! [ValueError] Red component is out of range, must be between 0 and 255 (inclusive)
-!! [ValueError] Green component is out of range, must be between 0 and 255 (inclusive)
-!! [ValueError] Green component is out of range, must be between 0 and 255 (inclusive)
-!! [ValueError] Blue component is out of range, must be between 0 and 255 (inclusive)
-!! [ValueError] Blue component is out of range, must be between 0 and 255 (inclusive)
+!! [ValueError] imagecolorallocate(): Argument #2 ($red) must be between 0 and 255 (inclusive)
+!! [ValueError] imagecolorallocate(): Argument #2 ($red) must be between 0 and 255 (inclusive)
+!! [ValueError] imagecolorallocate(): Argument #3 ($green) must be between 0 and 255 (inclusive)
+!! [ValueError] imagecolorallocate(): Argument #3 ($green) must be between 0 and 255 (inclusive)
+!! [ValueError] imagecolorallocate(): Argument #4 ($blue) must be between 0 and 255 (inclusive)
+!! [ValueError] imagecolorallocate(): Argument #4 ($blue) must be between 0 and 255 (inclusive)
--Hexa-decimal 0x100--
-!! [ValueError] Red component is out of range, must be between 0 and 255 (inclusive)
-!! [ValueError] Red component is out of range, must be between 0 and 255 (inclusive)
-!! [ValueError] Green component is out of range, must be between 0 and 255 (inclusive)
-!! [ValueError] Green component is out of range, must be between 0 and 255 (inclusive)
-!! [ValueError] Blue component is out of range, must be between 0 and 255 (inclusive)
-!! [ValueError] Blue component is out of range, must be between 0 and 255 (inclusive)
+!! [ValueError] imagecolorallocate(): Argument #2 ($red) must be between 0 and 255 (inclusive)
+!! [ValueError] imagecolorallocate(): Argument #2 ($red) must be between 0 and 255 (inclusive)
+!! [ValueError] imagecolorallocate(): Argument #3 ($green) must be between 0 and 255 (inclusive)
+!! [ValueError] imagecolorallocate(): Argument #3 ($green) must be between 0 and 255 (inclusive)
+!! [ValueError] imagecolorallocate(): Argument #4 ($blue) must be between 0 and 255 (inclusive)
+!! [ValueError] imagecolorallocate(): Argument #4 ($blue) must be between 0 and 255 (inclusive)
?>
--EXPECT--
-!! [ValueError] Color index 101 out of range
+!! [ValueError] imagecolordeallocate(): Argument #2 ($index) must be between 0 and 1
?>
--EXPECT--
-!! [ValueError] Color index -1 out of range
+!! [ValueError] imagecolordeallocate(): Argument #2 ($index) must be between 0 and 1
?>
--EXPECT--
-!! [ValueError] Convolution matrix must be a 3x3 array
+!! [ValueError] imageconvolution(): Argument #2 ($matrix3x3) must be a 3x3 array
?>
--EXPECT--
-!! [ValueError] Convolution matrix must be a 3x3 array, matrix[2] only has 2 elements
-!! [ValueError] Convolution matrix must be a 3x3 array, matrix[2][2] cannot be found (missing integer key)
+!! [ValueError] imageconvolution(): Argument #2 ($matrix3x3) must be a 3x3 array, matrix[2] only has 2 elements
+!! [ValueError] imageconvolution(): Argument #2 ($matrix3x3) must be a 3x3 array, matrix[2][2] cannot be found (missing integer key)
?>
--EXPECT--
-!! [ValueError] Invalid width (x_size)
-!! [ValueError] Invalid height (y_size)
+!! [ValueError] imagecreate(): Argument #1 ($x_size) must be greater than 0
+!! [ValueError] imagecreate(): Argument #2 ($y_size) must be greater than 0
?>
--EXPECT--
-!! [ValueError] Invalid width (x_size)
-!! [ValueError] Invalid height (y_size)
+!! [ValueError] imagecreatetruecolor(): Argument #1 ($x_size) must be greater than 0
+!! [ValueError] imagecreatetruecolor(): Argument #2 ($y_size) must be greater than 0
?>
--EXPECT--
-!! [ValueError] Number of colors has to be greater than zero and no more than 2147483647
+!! [ValueError] imagetruecolortopalette(): Argument #3 ($colorWanted) must be greater than 0 and less than 2147483647
?>
--EXPECT--
-!! [ValueError] Number of colors has to be greater than zero and no more than 2147483647
-!! [ValueError] Number of colors has to be greater than zero and no more than 2147483647
+!! [ValueError] imagetruecolortopalette(): Argument #3 ($colorWanted) must be greater than 0 and less than 2147483647
+!! [ValueError] imagetruecolortopalette(): Argument #3 ($colorWanted) must be greater than 0 and less than 2147483647
}
if (depth <= 0) {
- zend_value_error("Depth must be greater than zero");
+ zend_argument_value_error(3, "must be greater than 0");
RETURN_THROWS();
}
if (depth > INT_MAX) {
- zend_value_error("Depth must be lower than %d", INT_MAX);
+ zend_argument_value_error(3, "must be less than %d", INT_MAX);
RETURN_THROWS();
}
?>
--EXPECTF--
-Depth must be lower than %d
+json_decode(): Argument #3 ($depth) must be less than %d
*** Testing json_decode() : error conditions ***
-- Testing json_decode() function with depth below 0 --
-Depth must be greater than zero
+json_decode(): Argument #3 ($depth) must be greater than 0
}
if (ZEND_NUM_ARGS() >= 4 && CHECK_NULL_PATH(dbname, dbname_len)) {
- zend_value_error("dbname must not contain null bytes");
+ zend_argument_type_error(4, "must not contain null bytes");
RETURN_THROWS();
}
RETURN_THROWS();
}
- if ((ZEND_NUM_ARGS() >= 2 && CHECK_NULL_PATH(source_dbname, source_dbname_length))
- || (ZEND_NUM_ARGS() >= 3 && CHECK_NULL_PATH(destination_dbname, destination_dbname_length))
- ) {
- zend_value_error("dbname must not contain null bytes");
+ if (ZEND_NUM_ARGS() >= 2 && CHECK_NULL_PATH(source_dbname, source_dbname_length)) {
+ zend_argument_type_error(2, "must not contain null bytes");
+ RETURN_THROWS();
+ }
+
+ if (ZEND_NUM_ARGS() >= 3 && CHECK_NULL_PATH(destination_dbname, destination_dbname_length)) {
+ zend_argument_type_error(3, "must not contain null bytes");
RETURN_THROWS();
}
ZEND_PARSE_PARAMETERS_END();
if (mode != COUNT_NORMAL && mode != COUNT_RECURSIVE) {
- zend_value_error("Mode value is invalid");
+ zend_argument_value_error(2, "must be a valid mode");
RETURN_THROWS();
}
extract_type &= 0xff;
if (extract_type < EXTR_OVERWRITE || extract_type > EXTR_IF_EXISTS) {
- zend_value_error("Invalid extract type");
+ zend_argument_value_error(2, "must be a valid extract type");
RETURN_THROWS();
}
if (extract_type > EXTR_SKIP && extract_type <= EXTR_PREFIX_IF_EXISTS && ZEND_NUM_ARGS() < 3) {
- zend_value_error("Specified extract type requires the prefix parameter");
+ zend_argument_value_error(3, "is required when using this extract type");
RETURN_THROWS();
}
break;
default:
- zend_value_error("Unknown value " ZEND_LONG_FMT, what);
+ zend_argument_value_error(1, "must have a valid value");
break;
}
ZEND_PARSE_PARAMETERS_END();
if (setting_len == 0 || setting[0] == '=') {
- zend_value_error("Invalid parameter syntax");
+ zend_argument_value_error(1, "must have a valid syntax");
RETURN_THROWS();
}
ZEND_PARSE_PARAMETERS_END();
if (dirn_len < 1) {
- zend_value_error("Directory name cannot be empty");
+ zend_argument_value_error(1, "cannot be empty");
RETURN_THROWS();
}
ZEND_PARSE_PARAMETERS_END();
if (hostname_len == 0) {
- zend_value_error("Host cannot be empty");
+ zend_argument_value_error(1, "cannot be empty");
RETURN_THROWS();
}
}
if (hostname_len == 0) {
- zend_value_error("Host cannot be empty");
+ zend_argument_value_error(1, "cannot be empty");
RETURN_THROWS();
}
ZEND_PARSE_PARAMETERS_END();
if (flags < 0 || flags > (PHP_FILE_USE_INCLUDE_PATH | PHP_FILE_IGNORE_NEW_LINES | PHP_FILE_SKIP_EMPTY_LINES | PHP_FILE_NO_DEFAULT_CONTEXT)) {
- zend_value_error("'" ZEND_LONG_FMT "' flag is not supported", flags);
+ zend_argument_value_error(2, "must be a valid flag value");
RETURN_THROWS();
}
ZEND_PARSE_PARAMETERS_END();
if (size < 0) {
- zend_value_error("Negative size is not supported");
+ zend_argument_value_error(2, "must be greater than or equal to 0");
RETURN_THROWS();
}
int(0)
int(0)
int(0)
-Mode value is invalid
-Mode value is invalid
-Mode value is invalid
+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
int(0)
int(0)
int(0)
*** Testing Error Conditions ***
Notice: A non well formed numeric value encountered in %s on line %d
-Invalid extract type
-Invalid extract type
-Specified extract type requires the prefix parameter
+extract(): Argument #2 ($extract_type) must be a valid extract type
+extract(): Argument #2 ($extract_type) must be a valid extract type
+extract(): Argument #3 ($prefix) is required when using this extract type
}
?>
--EXPECT--
-Unknown value 1000
+assert_options(): Argument #1 ($what) must have a valid value
?>
--EXPECT--
-Directory name cannot be empty
+scandir(): Argument #1 ($directory) cannot be empty
}
?>
--EXPECT--
-Negative size is not supported
+ftruncate(): Argument #2 ($size) must be greater than or equal to 0
[2]=>
string(6) "Line 3"
}
-'24' flag is not supported
-'25' flag is not supported
-'26' flag is not supported
-'27' flag is not supported
-'28' flag is not supported
-'29' flag is not supported
-'30' flag is not supported
-'31' flag is not supported
-'32' flag is not supported
\ No newline at end of file
+file(): Argument #2 ($flags) must be a valid flag value
+file(): Argument #2 ($flags) must be a valid flag value
+file(): Argument #2 ($flags) must be a valid flag value
+file(): Argument #2 ($flags) must be a valid flag value
+file(): Argument #2 ($flags) must be a valid flag value
+file(): Argument #2 ($flags) must be a valid flag value
+file(): Argument #2 ($flags) must be a valid flag value
+file(): Argument #2 ($flags) must be a valid flag value
+file(): Argument #2 ($flags) must be a valid flag value
int(1200)
bool(true)
int(0)
-Negative size is not supported
+ftruncate(): Argument #2 ($size) must be greater than or equal to 0
int(0)
-- Testing ftruncate(): try truncating file to a negative size --
bool(true)
int(0)
-Negative size is not supported
+ftruncate(): Argument #2 ($size) must be greater than or equal to 0
int(0)
bool(false)
bool(true)
-- Testing ftruncate(): try truncating file to a negative size --
bool(true)
int(0)
-Negative size is not supported
+ftruncate(): Argument #2 ($size) must be greater than or equal to 0
int(0)
bool(false)
bool(true)
-- Testing ftruncate(): try truncating file to a negative size --
bool(true)
int(0)
-Negative size is not supported
+ftruncate(): Argument #2 ($size) must be greater than or equal to 0
int(0)
bool(false)
bool(true)
-- Testing ftruncate(): try truncating file to a negative size --
bool(true)
int(0)
-Negative size is not supported
+ftruncate(): Argument #2 ($size) must be greater than or equal to 0
int(0)
bool(false)
bool(true)
-- Testing ftruncate(): try truncating file to a negative size --
bool(true)
int(0)
-Negative size is not supported
+ftruncate(): Argument #2 ($size) must be greater than or equal to 0
int(0)
bool(false)
bool(true)
-- Testing ftruncate(): try truncating file to a negative size --
bool(true)
int(0)
-Negative size is not supported
+ftruncate(): Argument #2 ($size) must be greater than or equal to 0
int(0)
bool(false)
bool(true)
-- Testing ftruncate(): try truncating file to a negative size --
bool(true)
int(0)
-Negative size is not supported
+ftruncate(): Argument #2 ($size) must be greater than or equal to 0
int(0)
bool(false)
bool(true)
-- Testing ftruncate(): try truncating file to a negative size --
bool(true)
int(0)
-Negative size is not supported
+ftruncate(): Argument #2 ($size) must be greater than or equal to 0
int(0)
bool(false)
bool(true)
-- Testing ftruncate(): try truncating file to a negative size --
bool(true)
int(0)
-Negative size is not supported
+ftruncate(): Argument #2 ($size) must be greater than or equal to 0
int(0)
bool(false)
bool(true)
-- Testing ftruncate(): try truncating file to a negative size --
bool(true)
int(0)
-Negative size is not supported
+ftruncate(): Argument #2 ($size) must be greater than or equal to 0
int(0)
bool(false)
bool(true)
-- Testing ftruncate(): try truncating file to a negative size --
bool(true)
int(0)
-Negative size is not supported
+ftruncate(): Argument #2 ($size) must be greater than or equal to 0
int(0)
bool(false)
bool(true)
-- Testing ftruncate(): try truncating file to a negative size --
bool(true)
int(0)
-Negative size is not supported
+ftruncate(): Argument #2 ($size) must be greater than or equal to 0
int(0)
bool(false)
bool(true)
-- Testing ftruncate(): try truncating file to a negative size --
bool(true)
int(0)
-Negative size is not supported
+ftruncate(): Argument #2 ($size) must be greater than or equal to 0
int(0)
bool(false)
bool(true)
-- Testing ftruncate(): try truncating file to a negative size --
bool(true)
int(0)
-Negative size is not supported
+ftruncate(): Argument #2 ($size) must be greater than or equal to 0
int(0)
bool(false)
bool(true)
-- Testing ftruncate(): try truncating file to a negative size --
bool(true)
int(0)
-Negative size is not supported
+ftruncate(): Argument #2 ($size) must be greater than or equal to 0
int(0)
bool(false)
bool(true)
-- Testing ftruncate(): try truncating file to a negative size --
bool(true)
int(0)
-Negative size is not supported
+ftruncate(): Argument #2 ($size) must be greater than or equal to 0
int(0)
bool(false)
bool(true)
-- Testing ftruncate(): try truncating file to a negative size --
bool(true)
int(0)
-Negative size is not supported
+ftruncate(): Argument #2 ($size) must be greater than or equal to 0
int(0)
bool(false)
bool(true)
-- Testing ftruncate(): try truncating file to a negative size --
bool(true)
int(0)
-Negative size is not supported
+ftruncate(): Argument #2 ($size) must be greater than or equal to 0
int(0)
bool(false)
bool(true)
-- Testing ftruncate(): try truncating file to a negative size --
bool(true)
int(0)
-Negative size is not supported
+ftruncate(): Argument #2 ($size) must be greater than or equal to 0
int(0)
bool(false)
bool(true)
-- Testing ftruncate(): try truncating file to a negative size --
bool(true)
int(0)
-Negative size is not supported
+ftruncate(): Argument #2 ($size) must be greater than or equal to 0
int(0)
bool(false)
bool(true)
-- Testing ftruncate(): try truncating file to a negative size --
bool(true)
int(0)
-Negative size is not supported
+ftruncate(): Argument #2 ($size) must be greater than or equal to 0
int(0)
bool(false)
bool(true)
-- Testing ftruncate(): try truncating file to a negative size --
bool(true)
int(0)
-Negative size is not supported
+ftruncate(): Argument #2 ($size) must be greater than or equal to 0
int(0)
bool(false)
bool(true)
-- Testing ftruncate(): try truncating file to a negative size --
bool(true)
int(0)
-Negative size is not supported
+ftruncate(): Argument #2 ($size) must be greater than or equal to 0
int(0)
bool(false)
bool(true)
-- Testing ftruncate(): try truncating file to a negative size --
bool(true)
int(0)
-Negative size is not supported
+ftruncate(): Argument #2 ($size) must be greater than or equal to 0
int(0)
bool(false)
bool(true)
-- Testing ftruncate(): try truncating file to a negative size --
bool(true)
int(0)
-Negative size is not supported
+ftruncate(): Argument #2 ($size) must be greater than or equal to 0
int(0)
bool(false)
bool(true)
-- Testing ftruncate(): try truncating file to a negative size --
bool(true)
int(0)
-Negative size is not supported
+ftruncate(): Argument #2 ($size) must be greater than or equal to 0
int(0)
bool(false)
bool(true)
-- Testing ftruncate(): try truncating file to a negative size --
bool(true)
int(0)
-Negative size is not supported
+ftruncate(): Argument #2 ($size) must be greater than or equal to 0
int(0)
bool(false)
bool(true)
-- Testing ftruncate(): try truncating file to a negative size --
bool(true)
int(0)
-Negative size is not supported
+ftruncate(): Argument #2 ($size) must be greater than or equal to 0
int(0)
bool(false)
bool(true)
-- Testing ftruncate(): try truncating file to a negative size --
bool(true)
int(0)
-Negative size is not supported
+ftruncate(): Argument #2 ($size) must be greater than or equal to 0
int(0)
bool(false)
bool(true)
-- Testing ftruncate(): try truncating file to a negative size --
bool(true)
int(0)
-Negative size is not supported
+ftruncate(): Argument #2 ($size) must be greater than or equal to 0
int(0)
bool(false)
bool(true)
-- Testing ftruncate(): try truncating file to a negative size --
bool(true)
int(0)
-Negative size is not supported
+ftruncate(): Argument #2 ($size) must be greater than or equal to 0
int(0)
bool(false)
bool(true)
-- Testing ftruncate(): try truncating file to a negative size --
bool(true)
int(0)
-Negative size is not supported
+ftruncate(): Argument #2 ($size) must be greater than or equal to 0
int(0)
bool(false)
bool(true)
-- Testing ftruncate(): try truncating file to a negative size --
bool(true)
int(0)
-Negative size is not supported
+ftruncate(): Argument #2 ($size) must be greater than or equal to 0
int(0)
bool(false)
bool(true)
-- Testing ftruncate(): try truncating file to a negative size --
bool(true)
int(0)
-Negative size is not supported
+ftruncate(): Argument #2 ($size) must be greater than or equal to 0
int(0)
bool(false)
bool(true)
-- Testing ftruncate(): try truncating file to a negative size --
bool(true)
int(0)
-Negative size is not supported
+ftruncate(): Argument #2 ($size) must be greater than or equal to 0
int(0)
bool(false)
bool(true)
-- Testing ftruncate(): try truncating file to a negative size --
bool(true)
int(0)
-Negative size is not supported
+ftruncate(): Argument #2 ($size) must be greater than or equal to 0
int(0)
bool(false)
bool(true)
-- Testing ftruncate(): try truncating file to a negative size --
bool(true)
int(0)
-Negative size is not supported
+ftruncate(): Argument #2 ($size) must be greater than or equal to 0
int(0)
bool(false)
bool(true)
-- Testing ftruncate(): try truncating file to a negative size --
bool(true)
int(0)
-Negative size is not supported
+ftruncate(): Argument #2 ($size) must be greater than or equal to 0
int(0)
bool(false)
bool(true)
-- Testing ftruncate(): try truncating file to a negative size --
bool(true)
int(0)
-Negative size is not supported
+ftruncate(): Argument #2 ($size) must be greater than or equal to 0
int(0)
bool(false)
bool(true)
-- Testing ftruncate(): try truncating file to a negative size --
bool(true)
int(0)
-Negative size is not supported
+ftruncate(): Argument #2 ($size) must be greater than or equal to 0
int(0)
bool(false)
bool(true)
-- Testing ftruncate(): try truncating file to a negative size --
bool(true)
int(0)
-Negative size is not supported
+ftruncate(): Argument #2 ($size) must be greater than or equal to 0
int(0)
bool(false)
bool(true)
-- Testing ftruncate(): try truncating file to a negative size --
bool(true)
int(0)
-Negative size is not supported
+ftruncate(): Argument #2 ($size) must be greater than or equal to 0
int(0)
bool(false)
bool(true)
-- Testing ftruncate(): try truncating file to a negative size --
bool(true)
int(0)
-Negative size is not supported
+ftruncate(): Argument #2 ($size) must be greater than or equal to 0
int(0)
bool(false)
bool(true)
-- Testing ftruncate(): try truncating file to a negative size --
bool(true)
int(0)
-Negative size is not supported
+ftruncate(): Argument #2 ($size) must be greater than or equal to 0
int(0)
bool(false)
bool(true)
-- Testing ftruncate(): try truncating file to a negative size --
bool(true)
int(0)
-Negative size is not supported
+ftruncate(): Argument #2 ($size) must be greater than or equal to 0
int(0)
bool(false)
bool(true)
-- Testing ftruncate(): try truncating file to a negative size --
bool(true)
int(0)
-Negative size is not supported
+ftruncate(): Argument #2 ($size) must be greater than or equal to 0
int(0)
bool(false)
bool(true)
-- Testing ftruncate(): try truncating file to a negative size --
bool(true)
int(0)
-Negative size is not supported
+ftruncate(): Argument #2 ($size) must be greater than or equal to 0
int(0)
bool(false)
bool(true)
-- Testing ftruncate(): try truncating file to a negative size --
bool(true)
int(0)
-Negative size is not supported
+ftruncate(): Argument #2 ($size) must be greater than or equal to 0
int(0)
bool(false)
bool(true)
truncation with new_size=10
bool(true)
------ stream_truncate negative size: -------
-Negative size is not supported
+ftruncate(): Argument #2 ($size) must be greater than or equal to 0
------ stream_truncate bad return: -------
truncation with new_size=0
echo "Done\n";
?>
---EXPECTF--
+--EXPECT--
bool(false)
bool(true)
string(5) "value"
string(0) ""
bool(true)
bool(false)
-Invalid parameter syntax
-Invalid parameter syntax
+putenv(): Argument #1 ($setting) must have a valid syntax
+putenv(): Argument #1 ($setting) must have a valid syntax
Done
}
?>
--EXPECT--
-Host cannot be empty
+dns_check_record(): Argument #1 ($hostname) cannot be empty