File tree 2 files changed +12
-6
lines changed
2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -798,8 +798,8 @@ PHP_FUNCTION(imagesetstyle)
798
798
799
799
num_styles = zend_hash_num_elements (Z_ARRVAL_P (styles ));
800
800
if (num_styles == 0 ) {
801
- php_error_docref (NULL , E_WARNING , "styles array must not be empty" );
802
- RETURN_FALSE ;
801
+ zend_throw_error (NULL , "Styles array must not be empty" );
802
+ return ;
803
803
}
804
804
805
805
/* copy the style values in the stylearr */
Original file line number Diff line number Diff line change @@ -7,12 +7,18 @@ if (!extension_loaded('gd')) die('skip ext/gd not available');
7
7
--FILE--
8
8
<?php
9
9
$ im = imagecreatetruecolor (1 , 1 );
10
- var_dump (imagesetstyle ($ im , array ()));
10
+
11
+ try {
12
+ var_dump (imagesetstyle ($ im , array ()));
13
+ }
14
+ catch (\Error $ ex ) {
15
+ echo $ ex ->getMessage () . "\n" ;
16
+ }
17
+
11
18
imagesetpixel ($ im , 0 , 0 , IMG_COLOR_STYLED );
12
19
imagedestroy ($ im );
13
20
?>
14
21
====DONE====
15
- --EXPECTF--
16
- Warning: imagesetstyle(): styles array must not be empty in %s%ebug72709.php on line %d
17
- bool(false)
22
+ --EXPECT--
23
+ Styles array must not be empty
18
24
====DONE====
You can’t perform that action at this time.
0 commit comments