Skip to content

Commit 61d2b7a

Browse files
committed
Handle property, class constant, and method name collisions
1 parent ae38df3 commit 61d2b7a

File tree

2 files changed

+21
-21
lines changed

2 files changed

+21
-21
lines changed

build/gen_stub.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4135,12 +4135,12 @@ static function (FuncInfo $funcInfo) use ($allConstInfos) {
41354135
}
41364136

41374137
foreach ($funcInfo->attributes as $attribute) {
4138-
$code .= $attribute->generateCode("zend_add_function_attribute(zend_hash_str_find_ptr($functionTable, \"" . $funcInfo->name->getNameForAttributes() . "\", sizeof(\"" . $funcInfo->name->getNameForAttributes() . "\") - 1)", $funcInfo->name->getMethodSynopsisFilename(), $allConstInfos);
4138+
$code .= $attribute->generateCode("zend_add_function_attribute(zend_hash_str_find_ptr($functionTable, \"" . $funcInfo->name->getNameForAttributes() . "\", sizeof(\"" . $funcInfo->name->getNameForAttributes() . "\") - 1)", "func_" . $funcInfo->name->getNameForAttributes(), $allConstInfos);
41394139
}
41404140

41414141
foreach ($funcInfo->args as $index => $arg) {
41424142
foreach ($arg->attributes as $attribute) {
4143-
$code .= $attribute->generateCode("zend_add_parameter_attribute(zend_hash_str_find_ptr($functionTable, \"" . $funcInfo->name->getNameForAttributes() . "\", sizeof(\"" . $funcInfo->name->getNameForAttributes() . "\") - 1), $index", "{$funcInfo->name->getMethodSynopsisFilename()}_arg{$index}", $allConstInfos);
4143+
$code .= $attribute->generateCode("zend_add_parameter_attribute(zend_hash_str_find_ptr($functionTable, \"" . $funcInfo->name->getNameForAttributes() . "\", sizeof(\"" . $funcInfo->name->getNameForAttributes() . "\") - 1), $index", "func_{$funcInfo->name->getNameForAttributes()}_arg{$index}", $allConstInfos);
41444144
}
41454145
}
41464146

@@ -4161,7 +4161,7 @@ static function (ConstInfo $constInfo) use ($allConstInfos) {
41614161
$code = null;
41624162

41634163
foreach ($constInfo->attributes as $attribute) {
4164-
$code .= $attribute->generateCode("zend_add_class_constant_attribute(class_entry, const_" . $constInfo->name->getDeclarationName(), $constInfo->name->getDeclarationName(), $allConstInfos);
4164+
$code .= $attribute->generateCode("zend_add_class_constant_attribute(class_entry, const_" . $constInfo->name->getDeclarationName(), "const_" . $constInfo->name->getDeclarationName(), $allConstInfos);
41654165
}
41664166

41674167
return $code;
@@ -4177,7 +4177,7 @@ function generatePropertyAttributeInitialization(iterable $propertyInfos, iterab
41774177
$code = "";
41784178
foreach ($propertyInfos as $propertyInfo) {
41794179
foreach ($propertyInfo->attributes as $attribute) {
4180-
$code .= $attribute->generateCode("zend_add_property_attribute(class_entry, property_" . $propertyInfo->name->getDeclarationName(), $propertyInfo->name->getDeclarationName(), $allConstInfos);
4180+
$code .= $attribute->generateCode("zend_add_property_attribute(class_entry, property_" . $propertyInfo->name->getDeclarationName(), "property_" . $propertyInfo->name->getDeclarationName(), $allConstInfos);
41814181
}
41824182
}
41834183

ext/zend_test/test_arginfo.h

Lines changed: 17 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)