cvs: ZendEngine2 / zend_default_classes.c
| From: | Marcus Boerger | Date: | Sat, 25 Oct 2003 19:07:12 +0000 |
| Subject: | cvs: ZendEngine2 / zend_default_classes.c | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-1939@lists.php.net to get a copy of this message | ||
helly Sat Oct 25 15:07:12 2003 EDT
Modified files:
/ZendEngine2 zend_default_classes.c
Log:
You shall not clone Exception instances
Index: ZendEngine2/zend_default_classes.c
diff -u ZendEngine2/zend_default_classes.c:1.43 ZendEngine2/zend_default_classes.c:1.44
--- ZendEngine2/zend_default_classes.c:1.43 Wed Oct 22 16:04:48 2003
+++ ZendEngine2/zend_default_classes.c Sat Oct 25 15:07:09 2003
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_default_classes.c,v 1.43 2003/10/22 20:04:48 helly Exp $ */
+/* $Id: zend_default_classes.c,v 1.44 2003/10/25 19:07:09 helly Exp $ */
#include "zend.h"
#include "zend_API.h"
@@ -53,6 +53,12 @@
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 @@
* 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)