Skip to content

PHP 8Β #290

@i582

Description

@i582

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

Other

  • Stringable interface (RFC) πŸ”…
  • Ensure correct signatures of magic methods (RFC)
  • Add str_starts_with and str_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 ::class on 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

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)utable return type changed from DateTime to static
  • strtolower(), strtoupper(), stristr(), stripos(), strripos(), lcfirst(), ucfirst(), ucwords(), and str_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 by call_user_func()) are deprecated:
    • self::method
    • parent::method
    • "static::method"
    • ["self", "method"]
    • ["parent", "method"]
    • ["static", "method"]
    • ["Foo", "Bar::method"]
    • [new Foo, "Bar::method"]

Metadata

Metadata

Assignees

No one assigned

    Labels

    PHP8PHP8 feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions