Skip to content

Minimum version of PHP can be bumped to 7.4 #2340

@westonruter

Description

@westonruter

Now that core has bumped its minimum version of PHP to 7.4 (Core-62622), I think it's a good time to do the same for Performance Lab. This will allow us to eliminate two unit testing jobs.

We'll also be able to use native type hints more universally, eliminating this exclusion:

<property name="enableNativeTypeHint" value="false" /><!-- Only available in PHP 7.4+ -->

We can leverage other new features in PHP 7.3 and 7.4 (courtesy Gemini), although polyfills for some of these are already in core:

PHP 7.3

  • Flexible Heredoc/Nowdoc: Allows indented closing markers.
  • Trailing commas: Permitted in function calls.
  • JSON_THROW_ON_ERROR: New flag for exception-based JSON handling.
  • is_countable(): Direct check for countable types.
  • array_key_first() / array_key_last(): Efficiently get boundary keys.
  • PCRE2: Upgraded regular expression engine.

PHP 7.4

  • Typed Properties: Type hints for class members (e.g., public int $id).
  • Arrow Functions: Concise syntax for one-liners (fn() => ...).
  • Null Coalescing Assignment: The ??= operator.
  • Array Spread Operator: Unpacking arrays with ...$arr.
  • Numeric Separators: Using underscores in numbers (1_000_000).
  • Opcache Preloading: Performance boost via pre-loading files.
  • Weak References: References that don't prevent garbage collection.

Metadata

Metadata

Assignees

Labels

[Type] EnhancementA suggestion for improvement of an existing feature
No fields configured for Enhancement.

Projects

Status
Done 😃

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions