-
-
Notifications
You must be signed in to change notification settings - Fork 463
ref: remove polyfill #1922
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
ref: remove polyfill #1922
Conversation
|
Seems counterproductive to stop using newer PHP functions. What you want to do is to use "replace" in composer.json if you're annoyed by the polyfills or worried about disk space: "replace": {
"symfony/polyfill-ctype": "*",
"ralouphie/getallheaders": "*",
"symfony/polyfill-mbstring": "*",
} |
|
@glensc could you elaborate why you find it counterproductive? I personally don't see harm in replacing them with old PHP version equivalents. We don't have to pull in additional dependencies while still maintaining compatibility with PHP 7.2. Replace is not an option because we support PHP 7.2 and as far as I understand, using |
|
I don't see harm in using the polyfills; they are created to allow newer language functions. And if you want to use native functions, you can use "replace" to remove them from your vendor tree. The "replace" is not something the library should do; it's rather for each project (application). The bright side of the polyfills is that if you bump the required php version, you can just drop the polyfill from dependencies, no code changes are needed. I feel maintaining your own copy of some function is something you should not do. the copied function will not receive any security or bug fixes. probably nobody will even analyze it, comparing it being in polyfill library or language engine itself |
While not actively requiring it, we still had polyfill available through
symfony/options-resolver.This PR removes the remaining polyfilled constructs and replaces them with PHP 7.2 compatible code.