Skip to content

Commit a74eb24

Browse files
committed
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 phpGH-16247.
1 parent 2f52dbd commit a74eb24

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

UPGRADING

+4
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,10 @@ PHP 8.5 UPGRADE NOTES
102102
12. Windows Support
103103
========================================
104104

105+
* The configuration variables PHP_VERSION, PHP_MINOR_VERSION, and
106+
PHP_RELEASE_VERSION are now always numbers. Previously, they have been
107+
strings for buildconf builds.
108+
105109
========================================
106110
13. Other Changes
107111
========================================

win32/build/confutils.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,9 @@ function get_version_numbers()
108108
var regex = /AC_INIT.+(\d+)\.(\d+)\.(\d+)([^\,^\]]*).+/g;
109109

110110
if (cin.match(new RegExp(regex))) {
111-
PHP_VERSION = RegExp.$1;
112-
PHP_MINOR_VERSION = RegExp.$2;
113-
PHP_RELEASE_VERSION = RegExp.$3;
111+
PHP_VERSION = +RegExp.$1;
112+
PHP_MINOR_VERSION = +RegExp.$2;
113+
PHP_RELEASE_VERSION = +RegExp.$3;
114114
PHP_EXTRA_VERSION = RegExp.$4;
115115
}
116116

0 commit comments

Comments
 (0)