Unify types of PHP_VERSION and friends on Windows

For `phpize` builds, all three version variables are numbers, but for
`buildconf` builds, all are strings.  This can yield surprising results
when extensions create their `PHP_VERSION_ID` like

10000 * PHP_VERSION + 100 * PHP_MINOR_VERSION + PHP_RELEASE_VERSION

Since `phpize` builds are way more common for external extensions
nowadays, we change the types for `buildconf` builds.

Closes GH-16247.
This commit is contained in:
Christoph M. Becker 2024-10-05 15:16:49 +02:00
parent 2f52dbd7b7
commit a74eb24e69
No known key found for this signature in database
GPG Key ID: D66C9593118BCCB6
2 changed files with 7 additions and 3 deletions

View File

@ -102,6 +102,10 @@ PHP 8.5 UPGRADE NOTES
12. Windows Support
========================================
* The configuration variables PHP_VERSION, PHP_MINOR_VERSION, and
PHP_RELEASE_VERSION are now always numbers. Previously, they have been
strings for buildconf builds.
========================================
13. Other Changes
========================================

View File

@ -108,9 +108,9 @@ function get_version_numbers()
var regex = /AC_INIT.+(\d+)\.(\d+)\.(\d+)([^\,^\]]*).+/g;
if (cin.match(new RegExp(regex))) {
PHP_VERSION = RegExp.$1;
PHP_MINOR_VERSION = RegExp.$2;
PHP_RELEASE_VERSION = RegExp.$3;
PHP_VERSION = +RegExp.$1;
PHP_MINOR_VERSION = +RegExp.$2;
PHP_RELEASE_VERSION = +RegExp.$3;
PHP_EXTRA_VERSION = RegExp.$4;
}