diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2019-01-14 09:17:28 +0100 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2019-01-14 09:19:30 +0100 |
commit | d0fd2be64234d978e62fb27d6012087514550e71 (patch) | |
tree | 8788eaaa9f2d36b512cc9cccb255e429bc30db48 /Zend/zend_exceptions.c | |
parent | e25e2bd9bd0b878caf5fe80f6b53c7d42657ebd1 (diff) | |
download | php-git-d0fd2be64234d978e62fb27d6012087514550e71.tar.gz |
Revert removal of private __clone() methods
I thought these were redundant, because we already NULL out the
clone_obj object handler. However, it turns out that reflection is
using private __clone() to determine clonability (isCloneable) for
the case where we only have a class, rather than an object.
As such, removing these methods would be a BC break.
This reverts commit e7131a4e9fa0acf8fc1e486b49851e71859ef5b8.
This reverts commit 55bd88ce0d1bf461546d5d0b40920491d566ed48.
Diffstat (limited to 'Zend/zend_exceptions.c')
-rw-r--r-- | Zend/zend_exceptions.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Zend/zend_exceptions.c b/Zend/zend_exceptions.c index 848e15b855..8330aba632 100644 --- a/Zend/zend_exceptions.c +++ b/Zend/zend_exceptions.c @@ -251,6 +251,15 @@ static zend_object *zend_error_exception_new(zend_class_entry *class_type) /* {{ } /* }}} */ +/* {{{ proto Exception|Error Exception|Error::__clone() + Clone the exception object */ +ZEND_COLD ZEND_METHOD(exception, __clone) +{ + /* Should never be executable */ + zend_throw_exception(NULL, "Cannot clone object using __clone()", 0); +} +/* }}} */ + /* {{{ proto Exception|Error::__construct(string message, int code [, Throwable previous]) Exception constructor */ ZEND_METHOD(exception, __construct) @@ -763,6 +772,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_exception___construct, 0, 0, 0) ZEND_END_ARG_INFO() static const zend_function_entry default_exception_functions[] = { + ZEND_ME(exception, __clone, NULL, ZEND_ACC_PRIVATE|ZEND_ACC_FINAL) ZEND_ME(exception, __construct, arginfo_exception___construct, ZEND_ACC_PUBLIC) ZEND_ME(exception, __wakeup, NULL, ZEND_ACC_PUBLIC) ZEND_ME(exception, getMessage, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) |