summaryrefslogtreecommitdiff
path: root/Zend/zend_default_classes.c
diff options
context:
space:
mode:
authorMarcus Boerger <helly@php.net>2003-10-25 19:07:09 +0000
committerMarcus Boerger <helly@php.net>2003-10-25 19:07:09 +0000
commit4625529abedbc73b33695822d425ab9f609483d6 (patch)
treef15964b66cadf4b3ee2d91351d8c6b672737dbd7 /Zend/zend_default_classes.c
parentfe3db4c7e93fc2ae810fb0780dc67e11ab2ffd04 (diff)
downloadphp-git-4625529abedbc73b33695822d425ab9f609483d6.tar.gz
You shall not clone Exception instances
Diffstat (limited to 'Zend/zend_default_classes.c')
-rw-r--r--Zend/zend_default_classes.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/Zend/zend_default_classes.c b/Zend/zend_default_classes.c
index 619e9ec866..338e5fa1b8 100644
--- a/Zend/zend_default_classes.c
+++ b/Zend/zend_default_classes.c
@@ -53,6 +53,12 @@ static zend_object_value zend_default_exception_new(zend_class_entry *class_type
return obj.value.obj;
}
+ZEND_METHOD(reflection, __clone)
+{
+ /* Should never be executable */
+ _DO_THROW("Cannot clone object using __clone()");
+}
+
ZEND_METHOD(exception, __construct)
{
char *message = NULL;
@@ -348,6 +354,7 @@ ZEND_METHOD(exception, __toString)
* that gives the user anything to accomplish this.
*/
static zend_function_entry default_exception_functions[] = {
+ ZEND_ME(exception, __clone, NULL, ZEND_ACC_PRIVATE|ZEND_ACC_FINAL)
ZEND_ME(exception, __construct, NULL, 0)
ZEND_ME(exception, getMessage, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
ZEND_ME(exception, getCode, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)