Skip to content

Commit ae0bad5

Browse files
committed
Zend: expose zend_throw_exception_zstr() API
As having the message as a zend_string is not uncommon
1 parent 9762c44 commit ae0bad5

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

Zend/zend_exceptions.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -853,7 +853,7 @@ void zend_register_default_exception(void) /* {{{ */
853853
}
854854
/* }}} */
855855

856-
static zend_object *zend_throw_exception_zstr(zend_class_entry *exception_ce, zend_string *message, zend_long code) /* {{{ */
856+
ZEND_API ZEND_COLD zend_object *zend_throw_exception_zstr(zend_class_entry *exception_ce, zend_string *message, zend_long code) /* {{{ */
857857
{
858858
zval ex, tmp;
859859

Zend/zend_exceptions.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ ZEND_API void zend_register_default_classes(void);
5454

5555
/* exception_ce NULL, zend_ce_exception, zend_ce_error, or a derived class
5656
* message NULL or the message of the exception */
57+
ZEND_API ZEND_COLD zend_object *zend_throw_exception_zstr(zend_class_entry *exception_ce, zend_string *message, zend_long code);
5758
ZEND_API ZEND_COLD zend_object *zend_throw_exception(zend_class_entry *exception_ce, const char *message, zend_long code);
5859
ZEND_API ZEND_COLD zend_object *zend_throw_exception_ex(zend_class_entry *exception_ce, zend_long code, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 3, 4);
5960
ZEND_API ZEND_COLD void zend_throw_exception_object(zval *exception);

0 commit comments

Comments
 (0)