diff --git a/public/releases/8.6/languages/en.php b/public/releases/8.6/languages/en.php index be0949bcfe..4654625600 100644 --- a/public/releases/8.6/languages/en.php +++ b/public/releases/8.6/languages/en.php @@ -16,16 +16,16 @@ 'key_features_description' => '
Faster, cleaner, and built for developers.
', 'features_pfa_description' => 'Allows some of a function\'s arguments to be provided in advance, returning a Closure that accepts the rest.
', - 'features_readonly_property_defaults_description' => 'Allows default values for instance readonly properties.
', + 'features_readonly_property_defaults_description' => 'Allows readonly properties to declare default values, so fixed values no longer have to be assigned in the constructor.
', 'features_polling_api_description' => 'Scalable I/O multiplexing using epoll, kqueue, and other native mechanisms, available to event loop libraries like ReactPHP and AMPHP.
', 'features_clamp_description' => 'Ensures that a given value (numeric or otherwise) falls within a specified range.
', 'features_duration_description' => 'The Duration class represents elapsed time as measured by a stopwatch.
', - 'features_sort_direction_description' => 'SortDirection is an enum with exactly two cases (Ascending and Descending) and no associated behavior.
', + 'features_sort_direction_description' => 'A standard, type-safe way to express sort order, shared across libraries.
', 'pfa_title' => 'Partial Function Application', 'pfa_description' => 'Allows some of a function\'s arguments to be provided in advance, using? and ... placeholders for the rest. The result is a Closure, and the function is only called once the remaining arguments are passed to it.',
'readonly_property_defaults_title' => 'Readonly property defaults',
- 'readonly_property_defaults_description' => 'Allows default values for instance readonly properties.',
+ 'readonly_property_defaults_description' => 'Instance readonly properties, including those in readonly classes, can now declare a default value. This makes it simple to implement get-only interface properties with fixed values, which previously required assigning them in a constructor. The default counts as the property\'s initialization, so the constructor cannot overwrite it.',
'polling_api_title' => 'Polling API',
'polling_api_description' => 'The new Io\Poll API efficiently monitors many streams at once using the best mechanism available on each platform (epoll, kqueue, event ports, or WSAPoll), without the scalability limits of stream_select(). It is designed as a common foundation that event loop libraries such as ReactPHP and AMPHP can build on.',
'clamp_title' => 'New clamp() function',
@@ -33,7 +33,7 @@
'duration_title' => 'New \Time\Duration class',
'duration_description' => 'The Duration class represents elapsed time as measured by a stopwatch. Its representation is independent of any time and timezone and allows to represent a range of more than 250 years with nanosecond precision. This makes it well-suited to represent timeouts or benchmark timings in an expressive way.',
'sort_direction_title' => 'New SortDirection enum',
- 'sort_direction_description' => 'SortDirection is an enum with exactly two cases (Ascending and Descending) and no associated behavior.
Learn more about this feature in The PHP Foundation’s blog.
', + 'sort_direction_description' => 'The SortDirection enum provides a shared, type-safe way to express sort order with its Ascending and Descending cases. Previously, every library had to define its own way of representing sort direction, resulting in a mix of incompatible integers, strings, booleans, and custom enums. Since SortDirection is built into PHP, libraries can accept it in their public APIs without needing adapter code.
Learn more about this feature in The PHP Foundation’s blog.
', 'stream_error_handling_title' => 'Stream Error Handling', 'stream_error_handling_description' => 'Stream operations can now be configured to throw aStreamException or to fail silently instead of emitting warnings. Errors are reported as structured StreamError objects with a StreamErrorCode enum case, the wrapper name, and the affected path or URL, and can also be retrieved later with stream_last_errors() or passed to a custom error handler.',
'doc_comments_title' => 'DocComments For Function Parameters',
diff --git a/public/releases/8.6/release.inc b/public/releases/8.6/release.inc
index 541deabd10..d04bba0db5 100644
--- a/public/releases/8.6/release.inc
+++ b/public/releases/8.6/release.inc
@@ -28,31 +28,17 @@ $comparisons = [
message('documentation', $lang) . "|/manual/$documentation/functions.partial-application.php",
],
before: <<<'PHP'
- $versions = [
- '8.4',
- '8.5',
- '8.6',
- '8.7',
- // …
- '9.0',
- ];
-
- $supportsPartialFunctionApplication = array_filter(
+ $versions = ['8.4', '8.5', '8.6', '8.7', '9.0'];
+
+ $supported = array_filter(
$versions,
fn ($version) => version_compare($version, '8.6', '>='),
);
PHP,
after: <<<'PHP'
- $versions = [
- '8.4',
- '8.5',
- '8.6',
- '8.7',
- // …
- '9.0',
- ];
-
- $supportsPartialFunctionApplication = array_filter(
+ $versions = ['8.4', '8.5', '8.6', '8.7', '9.0'];
+
+ $supported = array_filter(
$versions,
version_compare(?, '8.6', '>='),
);
@@ -275,40 +261,48 @@ $comparisons = [
before: <<<'PHP'
class QueryBuilder
{
- private int $sort;
+ private array $orderBy = [];
- public function setSort(int $sort): void
- {
- $this->sort = $sort;
- }
-
- private function getSortKeyword(): string
- {
- return match($this->sort) {
+ public function orderBy(
+ string $column,
+ int $direction = SORT_ASC,
+ ): static {
+ $this->orderBy[] = $column . ' ' . match ($direction) {
SORT_ASC => 'ASC',
SORT_DESC => 'DESC',
};
+
+ return $this;
}
}
+
+ $qb->orderBy('name', SORT_DESC);
+ $qb->orderBy('name', SORT_STRING);
+ // Accepted by the signature, then fails inside the method:
+ // UnhandledMatchError: Unhandled match case 2
PHP,
after: <<<'PHP'
class QueryBuilder
{
- private SortDirection $sort;
-
- public function setSort(SortDirection $sort): void
- {
- $this->sort = $sort;
- }
+ private array $orderBy = [];
- private function getSortKeyword(): string
- {
- return match($this->sort) {
+ public function orderBy(
+ string $column,
+ SortDirection $direction = SortDirection::Ascending,
+ ): static {
+ $this->orderBy[] = $column . ' ' . match ($direction) {
SortDirection::Ascending => 'ASC',
SortDirection::Descending => 'DESC',
};
+
+ return $this;
}
}
+
+ $qb->orderBy('name', SortDirection::Descending);
+ $qb->orderBy('name', SORT_STRING);
+ // TypeError: QueryBuilder::orderBy(): Argument #2 ($direction)
+ // must be of type SortDirection, int given
PHP,
),
new FeatureComparison(