Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Tim Düsterhus <[email protected]>
Co-authored-by: Gina Peter Banyard <[email protected]>
Co-authored-by: Jorg Adam Sowa <[email protected]>
  • Loading branch information
4 people committed Oct 13, 2024
1 parent 87d3794 commit 68d6836
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 44 deletions.
25 changes: 7 additions & 18 deletions releases/8.4/languages/en.php
Original file line number Diff line number Diff line change
@@ -1,38 +1,27 @@
<?php

return [
'common_header' => 'PHP 8.4 is a major update of the PHP language. It contains many new features, such as property hooks, asymmetric visibility, lazy objects, and additions to the randomness functionality. As always it also includes performance improvements, bug fixes, and general cleanup.',
'common_header' => 'PHP 8.4 is a major update of the PHP language. It contains many new features, such as property hooks, asymmetric visibility, lazy objects, performance improvements, bug fixes, and general cleanup.',
'documentation' => 'Doc',
'main_title' => 'Released!',
'main_subtitle' => 'PHP 8.4 is a major update of the PHP language.<br class="display-none-md"> It contains many new features, such as property hooks, asymmetric visibility, lazy objects, and additions to the randomness functionality. As always it also includes performance improvements, bug fixes, and general cleanup.',
'main_subtitle' => 'PHP 8.4 is a major update of the PHP language.<br class="display-none-md"> It contains many new features, such as property hooks, asymmetric visibility, lazy objects, performance improvements, bug fixes, and general cleanup.',
'upgrade_now' => 'Upgrade to PHP 8.4 now!',

'property_hooks_title' => 'Property hooks',
'asymmetric_visibility_title' => 'Asymmetric Visibility',
'domdocument_html5_parser_title' => 'New HTML5 support',
'dom_additions_84_title' => 'New ext-dom features',
'lazy_objects_title' => 'Lazy Objects',
'dom_additions_html5_title' => 'New ext-dom features and HTML5 support',
'new_array_find_title' => 'New <code>array_*()</code> functions',
'new_array_find_description' => 'New functions <code>array_find()</code>, <code>array_find_key</code>, <code>array_any</code>, and <code>array_all</code> are available.',
'new_without_parentheses_title' => 'new MyClass()->method() without parentheses',

'new_classes_title' => 'New Classes, Interfaces, and Functions',
'new_bc_functions' => 'New <code>bcfloor()</code>, <code>bcceil()</code>, and <code>bcround()</code> functions.',
'new_dom_methods' => 'New <code>DOMNode::compareDocumentPosition()</code>, <code>DOMXPath::registerPhpFunctionNS()</code>, and <code>DOMXPath::quote()</code> methods.',
'new_intl_methods' => 'New <code>IntlDateFormatter::getIanaID()</code>, <code>IntlDateFormatter::parseToCalendar()</code>, and <code>SpoofChecker::setAllowedChars()</code> methods, and also <code>intltz_get_iana_id()</code>, <code>grapheme_str_split()</code> functions.',
'new_mbstring_functions' => 'New <code>mb_trim()</code>, <code>mb_ltrim()</code>, <code>mb_rtrim()</code>, <code>mb_ucfirst()</code>, and <code>mb_lcfirst()</code> functions.',
'new_pcntl_functions' => 'New <code>pcntl_setns()</code>, <code>pcntl_getcpuaffinity()</code>, <code>pcntl_setcpuaffinity()</code>, <code>pcntl_getcpu()</code>, <code>pcntl_waitid()</code>, and <code>pcntl_getqos_class()</code> functions.',
'new_pdo_method' => 'New <code>Pdo\Pgsql::setNoticeCallback()</code> method.',
'new_pgsql_functions' => 'New <code>pg_change_password()</code>, <code>pg_put_copy_data()</code>, <code>pg_socket_poll()</code>, <code>pg_jit()</code>, and <code>pg_set_chunked_rows_size()</code> functions.',
'new_reflection_methods' => 'New <code>ReflectionClass::newLazyGhost()</code>, <code>ReflectionClass::newLazyProxy()</code>, <code>ReflectionClass::resetAsLazyGhost()</code>, <code>ReflectionClass::resetAsLazyProxy()</code>, <code>ReflectionClass::isUninitializedLazyObject()</code>, <code>ReflectionClass::initializeLazyObject()</code>, <code>ReflectionClass::markLazyObjectAsInitialized()</code>, <code>ReflectionClass::getLazyInitializer()</code>, <code>ReflectionProperty::skipLazyInitialization</code>, and <code>ReflectionProperty::setRawValueWithoutLazyInitialization</code> methods.',
'new_sodium_functions' => 'New <code>sodium_crypto_aead_aegis128l_*()</code>, <code>sodium_crypto_aead_aegis256l_*()</code>, and <code>sodium_crypto_aead_aes256gcm_*()</code> functions.',
'new_soap_method' => 'New <code>SoapServer::__getLastResponse()</code> method.',
'new_standard_functions' => 'New <code>http_get_last_response_headers()</code>, <code>http_clear_last_response_headers()</code>, <code>fpow()</code>, <code>array_find()</code>, <code>array_find_key()</code>, <code>array_all()</code>, and <code>array_any()</code> functions.',
'new_tidy_methods' => 'New <code>tidyNode::getNextSibling()</code> and <code>tidyNode::getPreviousSibling()</code> methods.',
'new_xml_methods' => 'New <code>XMLReader::fromStream()</code>, <code>XMLReader::fromUri()</code>, <code>XMLReader::fromString()</code>, <code>XMLWriter::toStream()</code>, <code>XMLWriter::toUri()</code>, and <code>XMLWriter::toMemory()</code> methods.',
'new_xsl_method' => 'New <code>XSLTProcessor::registerPhpFunctionNS()</code> method.',

'bc_title' => 'Deprecations and backward compatibility breaks',
'bc_pecl' => 'The IMAP, OCI8, PDO_OCI, and pspell extensions have been unbundled and moved to PECL.',
'bc_nullable_parameter_types' => 'Implicitly nullable parameter types are now deprecated.',
'bc_classname' => 'Using <code>_</code> as a class name is now deprecated.',
'bc_zero_raised_to_negative_number' => 'Raising zero to the power of a negative number is now deprecated.',

'footer_title' => 'Better performance, better syntax, improved type safety.',
'footer_description' => '<p>For source downloads of PHP 8.4 please visit the <a href="/downloads">downloads</a> page. Windows binaries can be found on the <a href="https://windows.php.net/download">PHP for Windows</a> site. The list of changes is recorded in the <a href="/ChangeLog-8.php#PHP_8_4">ChangeLog</a>.</p>
Expand Down
96 changes: 70 additions & 26 deletions releases/8.4/release.inc
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ common_header(message('common_header', $lang));
<<<'PHP'
class User
{
public function __construct(private string $first, private string $last) {}
public function __construct(
private string $first,
private string $last
) {}
public function setFullName(string $value): string {
[$this->first, $this->last] = explode(' ', $value, 2);
Expand All @@ -70,7 +73,10 @@ PHP
<<<'PHP'
class User
{
public function __construct(private string $first, private string $last) {}
public function __construct(
private string $first,
private string $last
) {}
public string $fullName {
get {
Expand Down Expand Up @@ -104,7 +110,7 @@ class PhpVersion
}
$phpVersion = new PhpVersion();
$foo->version = 'PHP 8.4'; // No error
$phpVersion->version = 'PHP 8.4'; // No error
PHP

); ?>
Expand All @@ -122,17 +128,17 @@ class PhpVersion
}
$phpVersion = new PhpVersion();
$foo->version = 'PHP 8.3'; // Visibility error
$phpVersion->version = 'PHP 8.3'; // Visibility error
PHP
); ?>
</div>
</div>
</div>
</div>
<div class="php8-compare">
<h2 class="php8-h2" id="dom_additions_84">
<?= message('dom_additions_84_title', $lang) ?>
<a class="php8-rfc" href="https://wiki.php.net/rfc/dom_additions_84">RFC</a>
<h2 class="php8-h2" id="lazy_objects">
<?= message('lazy_objects_title', $lang) ?>
<a class="php8-rfc" href="https://wiki.php.net/rfc/lazy-objects">RFC</a>
</h2>
<div class="php8-compare__main">
<div class="php8-compare__block example-contents">
Expand Down Expand Up @@ -160,9 +166,10 @@ PHP
</div>
</div>
<div class="php8-compare">
<h2 class="php8-h2" id="domdocument_html5_parser">
<?= message('domdocument_html5_parser_title', $lang) ?>
<a class="php8-rfc" href="https://wiki.php.net/rfc/new_without_parentheses">RFC</a>
<h2 class="php8-h2" id="dom_additions_84">
<?= message('dom_additions_html5_title', $lang) ?>
<a class="php8-rfc" href="https://wiki.php.net/rfc/dom_additions_84">RFC</a>
<a class="php8-rfc" href="https://wiki.php.net/rfc/domdocument_html5_parser">RFC</a>
</h2>
<div class="php8-compare__main">
<div class="php8-compare__block example-contents">
Expand All @@ -189,6 +196,53 @@ PHP
</div>
</div>
</div>
<div class="php8-compare">
<h2 class="php8-h2" id="new_array_find">
<?= message('new_array_find_title', $lang) ?>
<a class="php8-rfc" href="https://wiki.php.net/rfc/array_find">RFC</a>
</h2>
<div class="php8-compare__main">
<div class="php8-compare__block example-contents">
<div class="php8-compare__label">PHP &lt; 8.4</div>
<div class="php8-code phpcode">
<?php highlight_php_trimmed(
<<<'PHP'
$animal = null;
foreach (['dog', 'cat', 'cow', 'duck', 'goose'] as $value) {
if (str_starts_with($value, 'c')) {
$animal = $value;
break;
}
}
var_dump($animal); // string(3) "cat"
PHP
); ?>
</div>
</div>
<div class="php8-compare__arrow"></div>
<div class="php8-compare__block example-contents">
<div class="php8-compare__label php8-compare__label_new">PHP 8.4</div>
<div class="php8-code phpcode">
<?php highlight_php_trimmed(
<<<'PHP'
var_dump(
array_find(
['dog', 'cat', 'cow', 'duck', 'goose'],
static function (string $value) {
return str_starts_with($value, 'c');
}
)
); // string(3) "cat"
PHP
); ?>
</div>
</div>
</div>
<div class="php8-compare__content">
<?= message('new_array_find_description', $lang) ?>
</div>
</div>
<div class="php8-compare">
<h2 class="php8-h2" id="new_without_parentheses">
<?= message('new_without_parentheses_title', $lang) ?>
Expand All @@ -200,7 +254,8 @@ PHP
<div class="php8-code phpcode">
<?php highlight_php_trimmed(
<<<'PHP'
class PhpVersion {
class PhpVersion
{
public function currentVersion(): string {
return 'PHP 8.3';
}
Expand All @@ -218,7 +273,8 @@ PHP
<div class="php8-code phpcode">
<?php highlight_php_trimmed(
<<<'PHP'
class PhpVersion {
class PhpVersion
{
public function currentVersion(): string {
return 'PHP 8.4';
}
Expand All @@ -239,20 +295,7 @@ PHP
<h2 class="php8-h2" id="other_new_things"><?= message('new_classes_title', $lang) ?></h2>
<div class="php8-compare__content php8-compare__content--block">
<ul>
<li><?= message('new_bc_functions', $lang) ?></li>
<li><?= message('new_dom_methods', $lang) ?></li>
<li><?= message('new_intl_methods', $lang) ?></li>
<li><?= message('new_mbstring_functions', $lang) ?></li>
<li><?= message('new_pcntl_functions', $lang) ?></li>
<li><?= message('new_pdo_method', $lang) ?></li>
<li><?= message('new_pgsql_functions', $lang) ?></li>
<li><?= message('new_reflection_methods', $lang) ?></li>
<li><?= message('new_sodium_functions', $lang) ?></li>
<li><?= message('new_soap_method', $lang) ?></li>
<li><?= message('new_standard_functions', $lang) ?></li>
<li><?= message('new_tidy_methods', $lang) ?></li>
<li><?= message('new_xml_methods', $lang) ?></li>
<li><?= message('new_xsl_method', $lang) ?></li>

</ul>
</div>
</div>
Expand All @@ -264,6 +307,7 @@ PHP
<li><?= message('bc_pecl', $lang) ?></li>
<li><?= message('bc_nullable_parameter_types', $lang) ?></li>
<li><?= message('bc_classname', $lang) ?></li>
<li><?= message('bc_zero_raised_to_negative_number', $lang) ?></li>
</ul>
</div>
</div>
Expand Down

0 comments on commit 68d6836

Please sign in to comment.