Closed llaville closed 5 months ago
Existing Random Number functions moved to the new random extension since PHP 8.2.0
But If you analyse a source code on previous platform like PHP 8.1 or less, the rule is that you should get expected version PHP min = 7.0.2
Component impacted is PHP CompatInfo DB that handle versionning of all elements including Doctrine ORM queries.
@MocioF FYI : I've already found what I think to be the best fix for this issue. I'll test it more to see if I find any regression. In case all will be ok, I'll release a PHP CompatInfo DB 6.4.1 that will include the correction.
All you'll then to do is run composer update
Thanks @llaville, I will upgrade the software, when you will merge the update.
For developers who want to learn more about this issue. Try these few examples to understand what's happens with CompatInfo DB releases 6.4.0 or lower.
vendor/bin/doctrine dbal:run-sql 'select * from classes where name = "AMQPException";'
---- -------------- --------------- ----------- ------- ---------- ------------- --------- --------- ---------
id extension_id name interface flags polyfill ext_min ext_max php_min php_max
---- -------------- --------------- ----------- ------- ---------- ------------- --------- --------- ---------
3 1 AMQPException 0 1 0.1.0 5.2.0
16 1 AMQPException 0 1 2.0.0alpha1 7.4.0
---- -------------- --------------- ----------- ------- ---------- ------------- --------- --------- ---------
Before fix, you should get php_min
= 5.2.0
whatever platform you are on
After fix, you will have php_min
= 7.4.0
if your platform is PHP 7.4.0 or greater
and php_min
= 5.2.0
if your platform is PHP 7.3.x or lower
vendor/bin/doctrine dbal:run-sql 'select * from constants where name = "T_BAD_CHARACTER";'
------ -------------- ----------------- ----------------- ---------- ------------ --------- --------- ------------ ---------
id extension_id name declaring_class polyfill deprecated ext_min ext_max php_min php_max
------ -------------- ----------------- ----------------- ---------- ------------ --------- --------- ------------ ---------
6842 94 T_BAD_CHARACTER 4.2.0 4.2.0 5.6.40
6977 94 T_BAD_CHARACTER 7.4.0 7.4.0beta1
------ -------------- ----------------- ----------------- ---------- ------------ --------- --------- ------------ ---------
Before fix, you should get php_min
= 4.2.0
whatever platform you are on
After fix, you will have php_min
= 7.4.0beta1
if your platform is PHP 7.4.0 or greater
and php_min
= 4.2.0
if your platform is PHP 7.3.x or lower
vendor/bin/doctrine dbal:run-sql 'select * from functions where name = "random_int";'
------ -------------- ------------ ------------ ---------- ----------------- ----------- ------- ---------- ------------ --------- ------------ ---------
id extension_id name parameters excludes declaring_class prototype flags polyfill ext_min ext_max php_min php_max
------ -------------- ------------ ------------ ---------- ----------------- ----------- ------- ---------- ------------ --------- ------------ ---------
5275 65 random_int 1 8.2.0beta1 8.2.0beta1
7969 86 random_int 1 7.0.2 7.0.2
------ -------------- ------------ ------------ ---------- ----------------- ----------- ------- ---------- ------------ --------- ------------ ---------
Before fix, you should get php_min
= 8.2.0beta1
whatever platform you are on
After fix, you will have php_min
= 8.2.0beta1
if your platform is PHP 8.2.0 or greater
and php_min
= 7.0.2
if your platform is PHP 8.2.0 or lower
Discussed in https://github.com/llaville/php-compatinfo/discussions/371