Skip to content

Commit add8c15

Browse files
committed
Align magic methods' camelCase with documentation
Closes GH-5398
1 parent ea0110f commit add8c15

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Zend/tests/magic_methods_010.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ class a {
1212
--EXPECTF--
1313
Warning: The magic method a::__toString() must have public visibility and cannot be static in %s on line %d
1414

15-
Fatal error: Method a::__tostring() cannot take arguments in %s on line %d
15+
Fatal error: Method a::__toString() cannot take arguments in %s on line %d

Zend/zend_API.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2019,10 +2019,10 @@ ZEND_API void zend_check_magic_method_implementation(const zend_class_entry *ce,
20192019
} else if (name_len == sizeof(ZEND_TOSTRING_FUNC_NAME) - 1 &&
20202020
!memcmp(lcname, ZEND_TOSTRING_FUNC_NAME, sizeof(ZEND_TOSTRING_FUNC_NAME)-1) && fptr->common.num_args != 0
20212021
) {
2022-
zend_error(error_type, "Method %s::%s() cannot take arguments", ZSTR_VAL(ce->name), ZEND_TOSTRING_FUNC_NAME);
2022+
zend_error(error_type, "Method %s::__toString() cannot take arguments", ZSTR_VAL(ce->name));
20232023
} else if (name_len == sizeof(ZEND_DEBUGINFO_FUNC_NAME) - 1 &&
20242024
!memcmp(lcname, ZEND_DEBUGINFO_FUNC_NAME, sizeof(ZEND_DEBUGINFO_FUNC_NAME)-1) && fptr->common.num_args != 0) {
2025-
zend_error(error_type, "Method %s::%s() cannot take arguments", ZSTR_VAL(ce->name), ZEND_DEBUGINFO_FUNC_NAME);
2025+
zend_error(error_type, "Method %s::__debugInfo() cannot take arguments", ZSTR_VAL(ce->name));
20262026
}
20272027
}
20282028
/* }}} */

0 commit comments

Comments
 (0)