#2747 - PHP refresh (ongoing)

Identifier #2747
Issue type Feature request or suggestion
Title PHP refresh (ongoing)
Status Open
Tags

Roadmap: ongoing (custom)

Roadmap: Over the horizon (custom)

Handling member Deleted
Addon core
Description When base line compat is for PHP 7.3...

Update CQC to be able to parse new syntax we don't necessarily intend to use right away:
Trailing commas in parameters of function calls
More Flexible Heredoc and Nowdoc Syntax

Update phpstub.php
new functions
array_key_first()
array_key_last()
hrtime()
is_countable()
param changes
setcookie() and setrawcookie() new signature

When base line compat is for PHP 7.4...

Update CQC to be able to parse new syntax we don't necessarily intend to use right away:
Spread Operator in Array Expression
Arrow Functions 2.0
Null Coalescing Assignment Operator
Numeric Literal Separator
New __serialize and __unserialize magic methods
'real' cast removed, and also is_real function

Update phpstub.php
param changes
The preg_replace_callback() and preg_replace_callback_array() functions now accept an additional $flags argument
strip_tags() now also accepts an array of allowed tags
proc_open() now accepts an array instead of a string for the command; PHP will take care of any necessary argument escaping

The allow_url_include ini directive is deprecated. Enabling it will generate a deprecation notice at startup

When base line compat is for PHP 8.0...

Enhance static typing
Union types

Implement PHP 8.2's Sensitive Parameter Value Redaction Support (we implement early knowing it won't do anything but won't create a parse error)

Update CQC to be able to parse new syntax we don't necessarily intend to use right away:
Named Arguments
Attributes
Constructor Property Promotion
Union Types
Match Expression
Nullsafe Operator
static (as in "late static binding") can now be used as a return type
It is now possible to fetch the class name of an object using $object::class
Traits can now define abstract private methods
An optional trailing comma is now allowed in parameter lists
Mixed type
It is now possible to write catch (Exception) to catch an exception without storing it in a variable

Update phpstub.php
Add get_resource_id
Add str_contains
Add str_starts_with
Add str_ends_with
Add fdiv
Add get_debug_type
array_diff(), array_intersect() and their variations can now be used with a single array as argument

When base line compat is for PHP 8.1...

Update CQC to be able to parse new syntax we don't necessarily intend to use right away:
Returning by reference from a void function
0o14; // Prefixed octal literal
Array Unpacking with String Keys
Named Argument After Argument Unpacking
Enumerations
First Class Callable Syntax
Intersection Types
Never type
Readonly properties
It is now possible to use new ClassName() expressions as the default value of a parameter, static variable, global constant initializers, and as attribute arguments. Objects can also be passed to define() now.
Final class constants

Update phpstub.php
Add array_is_list
Add fsync
Add fdatasync
fputcsv() now accepts a new eol argument which allow to define a custom End of Line sequence, the default remains the same and is "\n"

When base line compat is for PHP 8.2...

Make use of ini_parse_quantity

Enhance static typing
Specific "false" return type

cms_strtolower_ascii and cms_strtoupper_ascii won't be needed, and we can remove the health check about Turkish locale (I think)

Update CQC to be able to parse new syntax we don't necessarily intend to use right away:
Constraints in traits
Remove dynamic properties parsing support
Readonly Classes

Update phpstub.php
Add ini_parse_quantity
Add memory_reset_peak_usage as a comment (we don't need it)


For each update...

Update minimum version
PHP version health check
install.php
restore.php.pre
tut_web_hosting.txt

Search the code for 'LEGACY' comments to resolve
Steps to reproduce

Additional information When raising our minimum version, we may consider what is the minimum version of PHP still supported. However realistically we also need to consider that webhosts often fail to upgrade to newer versions, and people may be on different versions supplied by popular Red Hat distributions - which back port security fixes. So, proceed with some detailed consideration.
Related to

#2005 - Web standards refresh

Funded? No
The system will post a comment when this issue is modified (e.g., status changes). To be notified of this, click "Enable comment notifications".

Rating

Unrated