Skip to content

Commit

Permalink
- Fix string compare in unicode mode
Browse files Browse the repository at this point in the history
  • Loading branch information
johannes committed Mar 17, 2007
1 parent 53cf140 commit a9d3566
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ext/reflection/php_reflection.c
Expand Up @@ -2027,15 +2027,15 @@ ZEND_METHOD(reflection_parameter, getClass)
* TODO: Think about moving these checks to the compiler or some sort of
* lint-mode.
*/
if (0 == strncmp(param->arg_info->class_name.v, "self", sizeof("self")- 1)) {
if (ZEND_U_EQUAL(ZEND_STR_TYPE, param->arg_info->class_name, param->arg_info->class_name_len, "self", sizeof("self")- 1)) {
zend_class_entry *ce= param->fptr->common.scope;
if (!ce) {
zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
"Parameter uses 'self' as type hint but function is not a class member!");
return;
}
pce= &ce;
} else if (0 == strncmp(param->arg_info->class_name.v, "parent", sizeof("parent")- 1)) {
} else if (ZEND_U_EQUAL(ZEND_STR_TYPE, param->arg_info->class_name, param->arg_info->class_name_len, "parent", sizeof("parent")- 1)) {
zend_class_entry *ce= param->fptr->common.scope;
if (!ce) {
zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
Expand Down
6 changes: 6 additions & 0 deletions ext/reflection/tests/bug39884.phpt
Expand Up @@ -20,3 +20,9 @@ object(ReflectionClass)#4 (1) {
["name"]=>
string(13) "stubParamTest"
}
--UEXPECT--
object(ReflectionClass)#4 (1) {
[u"name"]=>
unicode(13) "stubParamTest"
}

0 comments on commit a9d3566

Please sign in to comment.