Skip to content

gen_stub: Fix undefined variable warning - #18821

Merged
TimWolla merged 1 commit into
php:masterfrom
TimWolla:gen_stub-warning
Jun 10, 2025
Merged

gen_stub: Fix undefined variable warning#18821
TimWolla merged 1 commit into
php:masterfrom
TimWolla:gen_stub-warning

Conversation

@TimWolla

Copy link
Copy Markdown
Member

PHP Warning: Undefined variable $code in build/gen_stub.php on line 5322

Introduced in #18735.

> PHP Warning: Undefined variable $code in build/gen_stub.php on line 5322
Introduced in php#18735.
Comment threadbuild/gen_stub.php
$constInfos,
"",
static function (ConstInfo $constInfo) use ($allConstInfos, $phpVersionIdMinimumCompatibility) {
$code = "";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW isn't it easier to assign the $code variable on line 5318, instead of concatenating to it, or am I missing something?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I felt that it would be more robust to always concatenate to not accidentally overwrite something when refactoring.

@TimWolla
TimWolla merged commit 5f9a0b5 into php:masterJun 10, 2025
@TimWolla
TimWolla deleted the gen_stub-warning branch June 10, 2025 13:28
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@TimWolla@kocsismate