From add8c15a317fc591e26f645989f03cd24d895b9c Mon Sep 17 00:00:00 2001 From: Gabriel Caruso Date: Thu, 16 Apr 2020 11:26:54 +0200 Subject: [PATCH] Align magic methods' camelCase with documentation Closes GH-5398 --- Zend/tests/magic_methods_010.phpt | 2 +- Zend/zend_API.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Zend/tests/magic_methods_010.phpt b/Zend/tests/magic_methods_010.phpt index 6118bda67b..4c939d3faa 100644 --- a/Zend/tests/magic_methods_010.phpt +++ b/Zend/tests/magic_methods_010.phpt @@ -12,4 +12,4 @@ class a { --EXPECTF-- Warning: The magic method a::__toString() must have public visibility and cannot be static in %s on line %d -Fatal error: Method a::__tostring() cannot take arguments in %s on line %d +Fatal error: Method a::__toString() cannot take arguments in %s on line %d diff --git a/Zend/zend_API.c b/Zend/zend_API.c index ea78c22a46..6d23b34372 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -2019,10 +2019,10 @@ ZEND_API void zend_check_magic_method_implementation(const zend_class_entry *ce, } else if (name_len == sizeof(ZEND_TOSTRING_FUNC_NAME) - 1 && !memcmp(lcname, ZEND_TOSTRING_FUNC_NAME, sizeof(ZEND_TOSTRING_FUNC_NAME)-1) && fptr->common.num_args != 0 ) { - zend_error(error_type, "Method %s::%s() cannot take arguments", ZSTR_VAL(ce->name), ZEND_TOSTRING_FUNC_NAME); + zend_error(error_type, "Method %s::__toString() cannot take arguments", ZSTR_VAL(ce->name)); } else if (name_len == sizeof(ZEND_DEBUGINFO_FUNC_NAME) - 1 && !memcmp(lcname, ZEND_DEBUGINFO_FUNC_NAME, sizeof(ZEND_DEBUGINFO_FUNC_NAME)-1) && fptr->common.num_args != 0) { - zend_error(error_type, "Method %s::%s() cannot take arguments", ZSTR_VAL(ce->name), ZEND_DEBUGINFO_FUNC_NAME); + zend_error(error_type, "Method %s::__debugInfo() cannot take arguments", ZSTR_VAL(ce->name)); } } /* }}} */ -- 2.40.0