Skip to content

More concrete return type for opcache_get_configuration#5424

Open
devnix wants to merge 1 commit intophpstan:2.1.xfrom
devnix:opcache_get_configuration
Open

More concrete return type for opcache_get_configuration#5424
devnix wants to merge 1 commit intophpstan:2.1.xfrom
devnix:opcache_get_configuration

Conversation

@devnix
Copy link
Copy Markdown
Contributor

@devnix devnix commented Apr 7, 2026

@VincentLanglet
Copy link
Copy Markdown
Contributor

Not sure such precision is needed ; wasn't https://github.com/phpstan/phpstan-src/pull/5422/changes enough ?
Dunno what you think about it @staabm ; this would make a huge constant array (which are often simplified)

@staabm
Copy link
Copy Markdown
Contributor

staabm commented Apr 7, 2026

what the real world use-case/motivation for this change?

@devnix
Copy link
Copy Markdown
Contributor Author

devnix commented Apr 7, 2026

Expecting a shape, avoiding unnecessary checks of array keys, reporting typos in array keys...

@staabm
Copy link
Copy Markdown
Contributor

staabm commented Apr 8, 2026

I think we can land the change after we added a separate NodeScopeResolverTest in nsrt/.

usually we don't enforce nsrt/ tests for changes in resources/functionMap.php but I think in this case it would be useful, because we add a very long line full of escaping etc. and its pretty easy to get something wrong in this case.

does the suggested return-type array-shape also work for PHP7?
is it something we need to make php version specific?

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.

3 participants