Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions public/releases/8.6/languages/en.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,24 @@
'key_features_description' => '<p><strong>Faster</strong>, <strong>cleaner</strong>, and <strong>built for developers</strong>.</p>',

'features_pfa_description' => '<p>Allows some of a function\'s arguments to be provided in advance, returning a Closure that accepts the rest.</p>',
'features_readonly_property_defaults_description' => '<p>Allows default values for instance readonly properties.</p>',
'features_readonly_property_defaults_description' => '<p>Allows readonly properties to declare default values, so fixed values no longer have to be assigned in the constructor.</p>',
'features_polling_api_description' => '<p>Scalable I/O multiplexing using epoll, kqueue, and other native mechanisms, available to event loop libraries like ReactPHP and AMPHP.</p>',
'features_clamp_description' => '<p>Ensures that a given value (numeric or otherwise) falls within a specified range.</p>',
'features_duration_description' => '<p>The Duration class represents elapsed time as measured by a stopwatch.</p>',
'features_sort_direction_description' => '<p>SortDirection is an enum with exactly two cases (Ascending and Descending) and no associated behavior.</p>',
'features_sort_direction_description' => '<p>A standard, type-safe way to express sort order, shared across libraries.</p>',

'pfa_title' => 'Partial Function Application',
'pfa_description' => 'Allows some of a function\'s arguments to be provided in advance, using <code>?</code> and <code>...</code> 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 <code>Io\Poll</code> 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 <code>stream_select()</code>. It is designed as a common foundation that event loop libraries such as ReactPHP and AMPHP can build on.',
'clamp_title' => 'New <code>clamp()</code> function',
'clamp_description' => 'Ensures that a given value (numeric or otherwise) falls within a specified range. Otherwise, the nearest boundary value is returned.',
'duration_title' => 'New <code>\Time\Duration</code> 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 <code>SortDirection</code> enum',
'sort_direction_description' => '<p>SortDirection is an enum with exactly two cases (Ascending and Descending) and no associated behavior.</p><p>Learn more about this feature in <a href="https://thephp.foundation/blog/2026/11/03/stdlib-investment/" target="_blank" rel="noopener noreferrer">The PHP Foundation’s blog</a>.</p>',
'sort_direction_description' => '<p>The <code>SortDirection</code> enum provides a shared, type-safe way to express sort order with its <code>Ascending</code> and <code>Descending</code> 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 <code>SortDirection</code> is built into PHP, libraries can accept it in their public APIs without needing adapter code.</p><p>Learn more about this feature in <a href="https://thephp.foundation/blog/2026/11/03/stdlib-investment/" target="_blank" rel="noopener noreferrer">The PHP Foundation’s blog</a>.</p>',
'stream_error_handling_title' => 'Stream Error Handling',
'stream_error_handling_description' => 'Stream operations can now be configured to throw a <code>StreamException</code> or to fail silently instead of emitting warnings. Errors are reported as structured <code>StreamError</code> objects with a <code>StreamErrorCode</code> enum case, the wrapper name, and the affected path or URL, and can also be retrieved later with <code>stream_last_errors()</code> or passed to a custom error handler.',
'doc_comments_title' => 'DocComments For Function Parameters',
Expand Down
70 changes: 32 additions & 38 deletions public/releases/8.6/release.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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', '>='),
);
Expand Down Expand Up @@ -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(
Expand Down
Loading