Skip to content

Commit

Permalink
Additions for PHP 8.4 page
Browse files Browse the repository at this point in the history
  • Loading branch information
saundefined committed Sep 22, 2024
1 parent 39c03e6 commit 87d3794
Show file tree
Hide file tree
Showing 2 changed files with 243 additions and 4 deletions.
27 changes: 25 additions & 2 deletions releases/8.4/languages/en.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,38 @@
<?php

return [
'common_header' => 'PHP 8.4 is a major update of the PHP language. It contains many new features, such as ... 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, and additions to the randomness functionality. As always it also includes 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 ... 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, and additions to the randomness functionality. As always it also includes 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',
'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.',

'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
220 changes: 218 additions & 2 deletions releases/8.4/release.inc
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,226 @@ common_header(message('common_header', $lang));
</div>
</section>

<section class="php8-section center">
<div class="php8-compare">
<h2 class="php8-h2" id="property_hooks">
<?= message('property_hooks_title', $lang) ?>
<a class="php8-rfc" href="https://wiki.php.net/rfc/property-hooks">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'
class User
{
public function __construct(private string $first, private string $last) {}
public function setFullName(string $value): string {
[$this->first, $this->last] = explode(' ', $value, 2);
}
public function getFullName(): string {
return $this->first . ' ' . $this->last;
}
}
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'
class User
{
public function __construct(private string $first, private string $last) {}
public string $fullName {
get {
return $this->first . " " . $this->last;
}
set (string $value) {
[$this->first, $this->last] = explode(' ', $value, 2);
}
}
}
PHP
); ?>
</div>
</div>
</div>
</div>
<div class="php8-compare">
<h2 class="php8-h2" id="asymmetric_visibility">
<?= message('asymmetric_visibility_title', $lang) ?>
<a class="php8-rfc" href="https://wiki.php.net/rfc/asymmetric-visibility-v2">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'
class PhpVersion
{
public string $version = '8.3';
}
$phpVersion = new PhpVersion();
$foo->version = 'PHP 8.4'; // No error
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'
class PhpVersion
{
public private(set) string $version = '8.4';
}
$phpVersion = new PhpVersion();
$foo->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>
<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'
// TODO
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'
// TODO
PHP
); ?>
</div>
</div>
</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>
<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'
// TODO
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'
// TODO
PHP
); ?>
</div>
</div>
</div>
</div>
<div class="php8-compare">
<h2 class="php8-h2" id="new_without_parentheses">
<?= message('new_without_parentheses_title', $lang) ?>
<a class="php8-rfc" href="https://wiki.php.net/rfc/new_without_parentheses">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'
class PhpVersion {
public function currentVersion(): string {
return 'PHP 8.3';
}
}
var_dump((new PhpVersion())->currentVersion());
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'
class PhpVersion {
public function currentVersion(): string {
return 'PHP 8.4';
}
}
var_dump(new PhpVersion()->currentVersion());
PHP
); ?>
</div>
</div>
</div>
</div>

</section>

<section class="php8-section center php8-section_light php8-columns">
<div class="php8-column">
<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 @@ -47,7 +261,9 @@ common_header(message('common_header', $lang));
<h2 class="php8-h2" id="deprecations_and_bc_breaks"><?= message('bc_title', $lang) ?></h2>
<div class="php8-compare__content">
<ul>

<li><?= message('bc_pecl', $lang) ?></li>
<li><?= message('bc_nullable_parameter_types', $lang) ?></li>
<li><?= message('bc_classname', $lang) ?></li>
</ul>
</div>
</div>
Expand Down

0 comments on commit 87d3794

Please sign in to comment.