And use things to throw an exception here

This commit is contained in:
Marcus Boerger 2003-10-25 19:13:06 +00:00
parent 4625529abe
commit cad49f1fb0
2 changed files with 6 additions and 4 deletions

View file

@ -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)

View file

@ -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)