Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for generating optimizer function info from stubs #7367

Merged
merged 11 commits into from
Aug 24, 2021

Conversation

kocsismate
Copy link
Member

@kocsismate kocsismate commented Aug 13, 2021

No description provided.

@kocsismate kocsismate marked this pull request as draft August 13, 2021 15:10
@kocsismate kocsismate marked this pull request as ready for review August 13, 2021 20:14
Zend/Optimizer/zend_func_info.c Outdated Show resolved Hide resolved
build/gen_stub.php Outdated Show resolved Hide resolved
nikic added a commit that referenced this pull request Aug 16, 2021
As pointed out on GH-7367, these have not been adjusted for
object constant support.

Now the only thing the type info specifies is that array of ref
is not possible.
Zend/zend_builtin_functions.stub.php Outdated Show resolved Hide resolved
ext/standard/basic_functions.stub.php Outdated Show resolved Hide resolved
build/gen_stub.php Outdated Show resolved Hide resolved
@kocsismate kocsismate force-pushed the stub-refcount branch 4 times, most recently from 83fc011 to e165a3a Compare August 16, 2021 10:15
/** @return string|array|object|null */
/**
* @return string|array<int, string|object>|object|null
* @refcount N
Copy link
Member

Choose a reason for hiding this comment

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

Similar to the @refcount 0 case, as @refcount N is the default state for non-scalar types, can we omit it and generate the func info based on presence of more specific return type?

Copy link
Member

Choose a reason for hiding this comment

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

Can these @refcount N lines be dropped after your last change?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I'll do that, thanks for pointing them out! Furthermore, I could forbid the addition of @refcount 1 and @refcount N. Another question I had: what to do with functions with void and never return type? Can I disallow adding a refcount (both implicitly and explicitly) to them?

I'll rebase to master soon.

Copy link
Member

@nikic nikic left a comment

Choose a reason for hiding this comment

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

Tests fail due to duplicate proc_open entry.

build/gen_stub.php Outdated Show resolved Hide resolved
build/gen_stub.php Outdated Show resolved Hide resolved
build/gen_stub.php Outdated Show resolved Hide resolved
build/gen_stub.php Outdated Show resolved Hide resolved
build/gen_stub.php Outdated Show resolved Hide resolved
build/gen_stub.php Outdated Show resolved Hide resolved
build/gen_stub.php Outdated Show resolved Hide resolved
@kocsismate kocsismate merged commit b182289 into php:master Aug 24, 2021
@kocsismate kocsismate deleted the stub-refcount branch August 24, 2021 14:35
@kocsismate
Copy link
Member Author

Pinging @ondrejmirtes as you might be interested in the array-related PHPDoc changes :)

@ondrejmirtes
Copy link
Contributor

@kocsismate Thank you, I'll look into it :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants