Skip to content

Commit 59dc172

Browse files
committed
Handle property, class constant, and method name collisions
1 parent 5c37675 commit 59dc172

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
@@ -4171,12 +4171,12 @@ static function (FuncInfo $funcInfo) use ($allConstInfos) {
41714171
}
41724172

41734173
foreach ($funcInfo->attributes as $attribute) {
4174-
$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);
4174+
$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);
41754175
}
41764176

41774177
foreach ($funcInfo->args as $index => $arg) {
41784178
foreach ($arg->attributes as $attribute) {
4179-
$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);
4179+
$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);
41804180
}
41814181
}
41824182

@@ -4197,7 +4197,7 @@ static function (ConstInfo $constInfo) use ($allConstInfos) {
41974197
$code = null;
41984198

41994199
foreach ($constInfo->attributes as $attribute) {
4200-
$code .= $attribute->generateCode("zend_add_class_constant_attribute(class_entry, const_" . $constInfo->name->getDeclarationName(), $constInfo->name->getDeclarationName(), $allConstInfos);
4200+
$code .= $attribute->generateCode("zend_add_class_constant_attribute(class_entry, const_" . $constInfo->name->getDeclarationName(), "const_" . $constInfo->name->getDeclarationName(), $allConstInfos);
42014201
}
42024202

42034203
return $code;
@@ -4213,7 +4213,7 @@ function generatePropertyAttributeInitialization(iterable $propertyInfos, iterab
42134213
$code = "";
42144214
foreach ($propertyInfos as $propertyInfo) {
42154215
foreach ($propertyInfo->attributes as $attribute) {
4216-
$code .= $attribute->generateCode("zend_add_property_attribute(class_entry, property_" . $propertyInfo->name->getDeclarationName(), $propertyInfo->name->getDeclarationName(), $allConstInfos);
4216+
$code .= $attribute->generateCode("zend_add_property_attribute(class_entry, property_" . $propertyInfo->name->getDeclarationName(), "property_" . $propertyInfo->name->getDeclarationName(), $allConstInfos);
42174217
}
42184218
}
42194219

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)