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

Automatic generation of deprecation notices #555

Open
shish opened this issue Feb 5, 2025 · 2 comments
Open

Automatic generation of deprecation notices #555

shish opened this issue Feb 5, 2025 · 2 comments
Labels
question Further information is requested

Comments

@shish
Copy link
Collaborator

shish commented Feb 5, 2025

Status quo as of this writing: If a function needs a safe wrapper in 8.1, but is natively safe from 8.2 onwards, then we generate a safe wrapper for 8.1 and a pass-through wrapper for 8.2 onwards

Question: should these pass-through wrappers be flagged as "deprecated", with a notice that people should just use the upstream function?

@shish shish added the question Further information is requested label Feb 5, 2025
@shish
Copy link
Collaborator Author

shish commented Feb 5, 2025

Right now if we drop support for php8.1, then these "functions which have been safe since 8.2" will be detected as "has always been safe", and the pass-through wrappers will no longer be generated. But it shouldn't be too hard to check back as far as 8.1 looking for unsafe functions, even if we're only generating code for 8.2+ -- and in that case we'd simply generate pass-through wrappers for all supported versions.

@shish shish mentioned this issue Feb 5, 2025
9 tasks
@shish
Copy link
Collaborator Author

shish commented Feb 5, 2025

My thinking for not marking these functions as deprecated is that if you're writing an app which needs to run on 8.3 and 8.4, then it would be annoying to see deprecation warnings in 8.4, but you can't do anything about it because you genuinely do need to use the Safe wrappers in 8.3.

A half-baked idea would be to have three states:

  • generate safe wrappers for unsafe functions
  • generate pass-through wrappers with no warning for functions which became safe recently
  • generate pass-through wrappers with a deprecation warning for functions which became safe a long time ago (ie, they are natively safe in all currently-supported versions of PHP)

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

No branches or pull requests

1 participant