summaryrefslogtreecommitdiff
path: root/Zend/zend_object_handlers.c
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/zend_object_handlers.c')
-rw-r--r--Zend/zend_object_handlers.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c
index 0e0b976032..6848977ae3 100644
--- a/Zend/zend_object_handlers.c
+++ b/Zend/zend_object_handlers.c
@@ -28,6 +28,7 @@
#include "zend_object_handlers.h"
#include "zend_interfaces.h"
#include "zend_closures.h"
+#include "zend_compile.h"
#define DEBUG_OBJECT_HANDLERS 0
@@ -941,7 +942,8 @@ ZEND_API zend_function *zend_std_get_static_method(zend_class_entry *ce, char *f
if (function_name_strlen == ce->name_length && ce->constructor) {
lc_class_name = zend_str_tolower_dup(ce->name, ce->name_length);
- if (!memcmp(lc_class_name, function_name_strval, function_name_strlen)) {
+ /* Only change the method to the constructor if a __construct() method doesn't exist */
+ if (!memcmp(lc_class_name, function_name_strval, function_name_strlen) && memcmp(ce->constructor->common.function_name, ZEND_CONSTRUCTOR_FUNC_NAME, sizeof(ZEND_CONSTRUCTOR_FUNC_NAME))) {
fbc = ce->constructor;
}
efree(lc_class_name);