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

Mark ob_*() functions has side-effects #3867

Open
wants to merge 1 commit into
base: 1.12.x
Choose a base branch
from

Conversation

zonuexe
Copy link
Contributor

@zonuexe zonuexe commented Mar 10, 2025

resolve phpstan/phpstan#12577

All ob_*() functions are impure.

It's possible to implement state like clearstatcache() in scopes, but it probably makes sense to just mark these as ['hasSideEffects' => true] and leave it at that.

@ondrejmirtes
Copy link
Member

Please follow instructions here

/**
* GENERATED FILE - DO NOT EDIT!
*
* This file is generated automatically when running bin/generate-function-metadata.php
* and the result is merged from bin/functionMetadata_original.php and by looking at jetbrains/phpstorm-stubs methods
* and functions with the #[Pure] attribute.
*
* If you want to add new entries here follow these steps:
* 1) verify on https://phpstan.org/try whether the entry you are going to add does not already work as expected.
* 2) Contribute the functions that have 'hasSideEffects' => true as a modification to bin/functionMetadata_original.php.
* 3) Contribute the #[Pure] functions without side effects to https://github.com/JetBrains/phpstorm-stubs
* 4) Once the PR from 3) is merged, please update the package here and run ./bin/generate-function-metadata.php.
*/

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.

2 participants