Open thekid opened 1 year ago
As long as it's not a major hassle to support PHP 7.x we can also continue to keep compatibility with it, though.
It could be worthwhile dropping PHP < 7.4 for:
$offset
parameter (7.1)All PHP 8.0 features @ https://wiki.php.net/rfc#php_80
https://externals.io/message/122214
This would introduce the situation of not being able to write nullable parameters in a way that works for all PHP versions. PHP 7.0 needs T $arg= null
, which would be deprecated and create warnings.
One argument more to only keep support for PHP 7.4
This would introduce the situation of not being able to write nullable parameters in a way that works for all PHP versions
Made XP 11 compatible by suppressing this specific error, see https://github.com/xp-framework/core/releases/tag/v11.9.0
This would introduce the situation of not being able to write nullable parameters in a way that works for all PHP versions
We should safely be able to drop at least PHP 7.0 as even really old Ubuntu versions come with 7.2:
This would allow us to restore full compatibility with the implicit nullable types deprecation as we can use https://wiki.php.net/rfc/nullable_types syntax while still supporting the broadest possible range of PHP versions!
Dropping 7.0 would also make these conditionals unnecessary:
$ grep -Hrn PHP_VERSION src/main/php/ | grep 70100
src/main/php/lang/ClassLoader.class.php:231: $constraint= (PHP_VERSION_ID >= 70100 ? $t->getName() : $t->__toString());
src/main/php/lang/ClassLoader.class.php:233: $constraint= '\\'.(PHP_VERSION_ID >= 70100 ? $t->getName() : $t->__toString());
src/main/php/lang/ClassLoader.class.php:253: $decl.= ':'.(PHP_VERSION_ID >= 70100 ? $t->getName() : $t->__toString());
src/main/php/lang/ClassLoader.class.php:255: $decl.= ': \\'.(PHP_VERSION_ID >= 70100 ? $t->getName() : $t->__toString());
src/main/php/lang/ClassLoader.class.php:303: if (null !== $t && 'void' === (PHP_VERSION_ID >= 70100 ? $t->getName() : $t->__toString())) {
src/main/php/lang/Environment.class.php:17: foreach (PHP_VERSION_ID >= 70100 ? getenv() : $_SERVER as $name => $value) {
src/main/php/lang/Environment.class.php:32: $variables= PHP_VERSION_ID >= 70100 ? getenv() : $_SERVER;
src/main/php/lang/reflect/Field.class.php:99: $name= PHP_VERSION_ID >= 70100 ? $t->getName() : $t->__toString();
src/main/php/lang/reflect/Parameter.class.php:107: $name= PHP_VERSION_ID >= 70100 ? $t->getName() : $t->__toString();
src/main/php/lang/reflect/Routine.class.php:168: $name= PHP_VERSION_ID >= 70100 ? $t->getName() : $t->__toString();
src/main/php/lang/Type.class.php:256: $name= PHP_VERSION_ID >= 70100 ? $type->getName() : $type->__toString();
PHP 7.1 comes with a variety of syntactical features:
See https://wiki.php.net/rfc#php_71
PHP 7.2, 7.3 and 7.4 offer the following on top:
See https://wiki.php.net/rfc#php_72, https://wiki.php.net/rfc#php_73 and https://wiki.php.net/rfc#php_74
Our path forward could be as follows:
Alternatively, a more "agressive" (see above for how long PHP 7.4 has been EOL) path could be:
Alternatively, a more "agressive" (see above for how long PHP 7.4 has been EOL) path could be: [...] XP 12 drops PHP 7.0 - 7.3 support
Following this path, quite a bit of libraries have been pushed to 7.4+ in the meantime
Scope of Change
This RFC suggests dropping PHP 7 support
Rationale
PHP 7.4 is EOL since November 28, 2022: https://twitter.com/official_php/status/1597203297537957888
Functionality
?->
nullsafe operatorSecurity considerations
n/a
Speed impact
Better
Dependencies
Major version
Related documents
https://www.php.net/releases/8.0/en.php