Welcome Guest, Not a member yet? Register   Sign In
php 8 polyfill
#1

At the moment, a PR has been added that implements a polyfill for the str_contains function from PHP-8.
I myself once wanted to implement something similar, but there is one caveat.
It seems to me that the best solution would be to create a separate package in the official repository with a polyfill for all string functions added in php-8 and add it to the composer dependency.

Why a package and not an integration into the core of the framework?
When the minimum php version for the framework is 8.0, the maintainers will not need to remove the polyfill from the core. They can simply exclude the package from the composer dependencies.
Reply
#2

Why don't you use https://github.com/symfony/polyfill-php80 ?
Reply
#3

There is no problem for me to use the symfony polyfill.
However, the CI team still supports the distribution of the framework via a zip archive, which makes it "a little" difficult to install external packages.

I think that the symphony team will hardly agree to add a description of the installation of their package from the archive as a third-party library in the CI environment.
Reply
#4

Sorry, I don't get what you mean exactly.

>  the best solution would be to create a separate package in the official repository with a polyfill for all string functions added in php-8 and add it to the composer dependency.

I understand your opinion is that we create a new composer package of php8 polyfill.
If so, I thought what's the difference between our polyfill and symfony polyfill?

> However, the CI team still supports the distribution of the framework via a zip archive, which makes it "a little" difficult to install external packages.

Do you mean we include our polyfill in the CI4 Zip file?
Reply
#5

Sometimes my thoughts run faster than I can express them in words.
(Only now I realized that I was calling the repository a package =))

I meant that the package (symfony/polyfill) can be added for those who do not want to use the composer in the same way as PSR\Log, Kint and Escaper were added.
Reply
#6

(12-26-2021, 06:26 PM)iRedds Wrote: I meant that the package (symfony/polyfill) can be added for those who do not want to use the composer in the same way as PSR\Log, Kint and Escaper were added.

I got what you meant.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB