@@ -3885,7 +3885,7 @@ PHP_FUNCTION(imageaffine)
38853885 src = php_gd_libgdimageptr_from_zval_p (IM );
38863886
38873887 if ((nelems = zend_hash_num_elements (Z_ARRVAL_P (z_affine ))) != 6 ) {
3888- zend_value_error ( "Affine array must have six elements" );
3888+ zend_argument_value_error ( 2 , " must have 6 elements" );
38893889 RETURN_THROWS ();
38903890 }
38913891
@@ -3902,7 +3902,7 @@ PHP_FUNCTION(imageaffine)
39023902 affine [i ] = zval_get_double (zval_affine_elem );
39033903 break ;
39043904 default :
3905- zend_type_error ( "Invalid type for element %i" , i );
3905+ zend_argument_type_error ( 3 , "contains invalid type for element %i" , i );
39063906 RETURN_THROWS ();
39073907 }
39083908 }
@@ -3970,7 +3970,7 @@ PHP_FUNCTION(imageaffinematrixget)
39703970 case GD_AFFINE_SCALE : {
39713971 double x , y ;
39723972 if (!options || Z_TYPE_P (options ) != IS_ARRAY ) {
3973- zend_type_error ( "Array expected as options when using translate or scale" );
3973+ zend_argument_type_error ( 1 , "must be of type array when using translate or scale" );
39743974 RETURN_THROWS ();
39753975 }
39763976
@@ -4002,7 +4002,7 @@ PHP_FUNCTION(imageaffinematrixget)
40024002 double angle ;
40034003
40044004 if (!options ) {
4005- zend_type_error ( "Number is expected as option when using rotate or shear" );
4005+ zend_argument_type_error ( 2 , "must be of type int|double when using rotate or shear" );
40064006 RETURN_THROWS ();
40074007 }
40084008
@@ -4019,7 +4019,7 @@ PHP_FUNCTION(imageaffinematrixget)
40194019 }
40204020
40214021 default :
4022- zend_value_error ( "Invalid type for element " ZEND_LONG_FMT , type );
4022+ zend_argument_value_error ( 1 , "must be a valid element type" );
40234023 RETURN_THROWS ();
40244024 }
40254025
@@ -4068,7 +4068,7 @@ PHP_FUNCTION(imageaffinematrixconcat)
40684068 m1 [i ] = zval_get_double (tmp );
40694069 break ;
40704070 default :
4071- zend_type_error ( "Matrix 1 contains invalid type for element %i" , i );
4071+ zend_argument_type_error ( 1 , " contains invalid type for element %i" , i );
40724072 RETURN_THROWS ();
40734073 }
40744074 }
@@ -4085,7 +4085,7 @@ PHP_FUNCTION(imageaffinematrixconcat)
40854085 m2 [i ] = zval_get_double (tmp );
40864086 break ;
40874087 default :
4088- zend_type_error ( "Matrix 2 contains invalid type for element %i" , i );
4088+ zend_argument_type_error ( 2 , " contains invalid type for element %i" , i );
40894089 RETURN_THROWS ();
40904090 }
40914091 }
@@ -4299,7 +4299,7 @@ static void _php_image_output_ctx(INTERNAL_FUNCTION_PARAMETERS, int image_type,
42994299 close_stream = 0 ;
43004300 } else if (Z_TYPE_P (to_zval ) == IS_STRING ) {
43014301 if (CHECK_ZVAL_NULL_PATH (to_zval )) {
4302- zend_type_error ( "Invalid 2nd parameter, filename must not contain null bytes" );
4302+ zend_argument_type_error ( 2 , " must not contain null bytes" );
43034303 RETURN_THROWS ();
43044304 }
43054305
0 commit comments