-
Notifications
You must be signed in to change notification settings - Fork 110
Open
Labels
PHP8PHP8 featurePHP8 feature
Description
PHP 8.x added a lot of different things and changed a lot of behaviors.
This issue is tracking the status of PHP 8 implementation in KPHP.
The following emoji will be used to denote the task status:
- π β high priority
- π β low priority
- πΈ β breaks backward compatibility
- πΊ β will not be changed in KPHP
- β³ β syntax is supported at the parser level
- π¨ β in progress
PHP 8.0
Added
New syntax
- Attributes (RFC) π | initial parser support for attributesΒ #333
- Union types in type hints (RFC) | [compiler] add basic support for type-checked mixed union typesΒ #734
-
nullsafeoperator (?->) (RFC) π | π¨ [php8] Nullsafe operator implementationΒ #686 -
staticreturn typehint (RFC) -
matchexpression (RFC) π | π¨matchexpressionΒ #303 Implementation ofmatchexpressionΒ #724 -
throwcan be used as an expression (RFC) π - Block
catchwithout variable (RFC) | allowedcatchwithout variableΒ #309 - Named arguments (RFC) π | π¨ WIP: named argumentsΒ #317 Named argsΒ #853
- Declaring properties in the constructor (RFC) π | added support for property promotionΒ #310
- Trailing comma in parameter lists and closure use list (RFC), (RFC) | π¨ allowed trailing comma for function parameter lists and closure use listsΒ #308 Allow trailing comma for function use and parameter listsΒ #664
Other
-
Stringableinterface (RFC) π - Ensure correct signatures of magic methods (RFC)
- Add
str_starts_withandstr_ends_with(RFC) π - Add
str_contains(RFC) π
Changed
- Saner numeric strings (RFC) πΈ
- Saner string to number comparisons (RFC) πΈ
- Locale-independent float to string cast (RFC) πΈ
- Sorting now stable (RFC) πΈ
- Names in the namespace are treated as a single token (RFC)
- Deferencable changes and arbitrary expressions in
new/instanceof(RFC) - Access
::classon object (RFC) π - Concatenation precedence (RFC) πΈ
- Arrays starting with a negative index (RFC) πΈ
Removed
-
Remove
(real)cast (without separate RFC) πΊ -
Remove
(unset)cast (without separate RFC) πΊ -
Remove
{}access (without separate RFC) πΊ
PHP 8.1
Added
New syntax
- Readonly properties (RFC) | added
readonlymodifier support for propertiesΒ #307 -
nevertype (RFC) | added support fornevertypeΒ #337 - Enums (RFC) π | π¨ Implementation of
enumΒ #824 - Final class constants (RFC) | added support for final constantsΒ #336
- β³ First-class callable syntax (RFC) π¨
- β³ Explicit octal integer literal notation (RFC) π π¨
- Pure intersection types (RFC) πΊ
Other
-
array_is_list(array $array): bool(RFC)
Changed
- New in initializers (RFC)
- Array unpacking with string keys (RFC) πΈ
- Static variables in inherited methods (RFC) πΊ
PHP 8.2
Added
New syntax
- β³ Readonly classes (RFC) π¨
- β³ Disjunctive Normal Form Types (RFC) π¨
- Allow null and false as stand-alone types (RFC) | commit
- β³ Add true type (RFC) π¨
- β³ Constants in Trait (RFC) π¨
Other
- Add flag
FILTER_FLAG_GLOBAL_RANGE
Changed
- Deprecate dynamic properties (RFC)
- Deprecate ${} string interpolation (RFC)
-
DateTime::createFrom(Im|M)utablereturn type changed fromDateTimetostatic -
strtolower(),strtoupper(),stristr(),stripos(),strripos(),lcfirst(),ucfirst(),ucwords(), andstr_ireplace()are no longer locale-sensitive -
str_split()returns an empty array for an empty string now - Callables that are not accepted by the
$callable()syntax (but are accepted bycall_user_func()) are deprecated:self::methodparent::method"static::method"["self", "method"]["parent", "method"]["static", "method"]["Foo", "Bar::method"][new Foo, "Bar::method"]
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
PHP8PHP8 featurePHP8 feature