kocsismate · GitHub

build/gen_stubs.php is also used by some PECL extensions or being encouraged to be used. Extension authors using gen_stub.php (or adopting it for the first time) might miss the effect this has when their extensions are built for php 7.4 and below - existing tests would pass, and end users would only notice if they attempted to use the wrong case for the constant.

There's also no way to force build/gen_stubs.php to emit CONST_CS (e.g. even for the legacy arginfo flags)

» php -a
Interactive shell
php > var_export(SOME_CONSTANT_FROM_STUBS);
283
php > var_export(some_constant_from_stubs);
Deprecated: Case-insensitive constants are deprecated. The correct casing for this constant is "SOME_CONSTANT_FROM_STUBS" in php shell code on line 1
283

Maybe there could be a .php_stubs_config.json file (or properties/env style file) and this could check all parent directories, if we want to apply certain settings that only work in php 8.3+ to all folders in php-src. Or just the existence of a .php_stubs_use_latest file, though a full config file would be better for customizations if we wanted them in the future

Read the original on github.com ↗