num_styles = zend_hash_num_elements(Z_ARRVAL_P(styles));
if (num_styles == 0) {
- php_error_docref(NULL, E_WARNING, "styles array must not be empty");
- RETURN_FALSE;
+ zend_throw_error(NULL, "Styles array must not be empty");
+ return;
}
/* copy the style values in the stylearr */
--FILE--
<?php
$im = imagecreatetruecolor(1, 1);
-var_dump(imagesetstyle($im, array()));
+
+try {
+ var_dump(imagesetstyle($im, array()));
+}
+catch (\Error $ex) {
+ echo $ex->getMessage() . "\n";
+}
+
imagesetpixel($im, 0, 0, IMG_COLOR_STYLED);
imagedestroy($im);
?>
====DONE====
---EXPECTF--
-Warning: imagesetstyle(): styles array must not be empty in %s%ebug72709.php on line %d
-bool(false)
+--EXPECT--
+Styles array must not be empty
====DONE====