mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
And use things to throw an exception here
This commit is contained in:
parent
4625529abe
commit
cad49f1fb0
2 changed files with 6 additions and 4 deletions
|
@ -27,6 +27,7 @@
|
||||||
|
|
||||||
static zend_class_entry *default_exception_ptr;
|
static zend_class_entry *default_exception_ptr;
|
||||||
static zend_object_handlers default_exception_handlers;
|
static zend_object_handlers default_exception_handlers;
|
||||||
|
ZEND_API void zend_throw_exception(zend_class_entry *exception_ce, char *message, long code TSRMLS_DC);
|
||||||
|
|
||||||
static zend_object_value zend_default_exception_new(zend_class_entry *class_type TSRMLS_DC)
|
static zend_object_value zend_default_exception_new(zend_class_entry *class_type TSRMLS_DC)
|
||||||
{
|
{
|
||||||
|
@ -53,10 +54,10 @@ static zend_object_value zend_default_exception_new(zend_class_entry *class_type
|
||||||
return obj.value.obj;
|
return obj.value.obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
ZEND_METHOD(reflection, __clone)
|
ZEND_METHOD(exception, __clone)
|
||||||
{
|
{
|
||||||
/* Should never be executable */
|
/* Should never be executable */
|
||||||
_DO_THROW("Cannot clone object using __clone()");
|
zend_throw_exception(NULL, "Cannot clone object using __clone()", 0 TSRMLS_CC);
|
||||||
}
|
}
|
||||||
|
|
||||||
ZEND_METHOD(exception, __construct)
|
ZEND_METHOD(exception, __construct)
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
|
|
||||||
static zend_class_entry *default_exception_ptr;
|
static zend_class_entry *default_exception_ptr;
|
||||||
static zend_object_handlers default_exception_handlers;
|
static zend_object_handlers default_exception_handlers;
|
||||||
|
ZEND_API void zend_throw_exception(zend_class_entry *exception_ce, char *message, long code TSRMLS_DC);
|
||||||
|
|
||||||
static zend_object_value zend_default_exception_new(zend_class_entry *class_type TSRMLS_DC)
|
static zend_object_value zend_default_exception_new(zend_class_entry *class_type TSRMLS_DC)
|
||||||
{
|
{
|
||||||
|
@ -53,10 +54,10 @@ static zend_object_value zend_default_exception_new(zend_class_entry *class_type
|
||||||
return obj.value.obj;
|
return obj.value.obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
ZEND_METHOD(reflection, __clone)
|
ZEND_METHOD(exception, __clone)
|
||||||
{
|
{
|
||||||
/* Should never be executable */
|
/* Should never be executable */
|
||||||
_DO_THROW("Cannot clone object using __clone()");
|
zend_throw_exception(NULL, "Cannot clone object using __clone()", 0 TSRMLS_CC);
|
||||||
}
|
}
|
||||||
|
|
||||||
ZEND_METHOD(exception, __construct)
|
ZEND_METHOD(exception, __construct)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue