-
Notifications
You must be signed in to change notification settings - Fork 534
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] PHP 8.4 release page #1079
base: master
Are you sure you want to change the base?
Conversation
🚀 Preview for commit b585014 can be found at https://web-php-pr-1079.preview.thephp.foundation |
🚀 Regression report for commit b585014 is at https://web-php-regression-report-pr-1079.preview.thephp.foundation |
<?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.', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Randomness functionality didn't have any additions for 8.4.
'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 property hooks, asymmetric visibility, lazy objects, and additions to the randomness functionality. As always it also includes performance improvements, bug fixes, and general cleanup.', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
<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> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong RFC link
<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 < 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 < 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> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These two can probably be merged into a single example. /cc @nielsdos
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably indeed. Thing is though that we do not have a counterpart for pre-8.4 for the new DOM additions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would not necessarily be a problem. The ext/random example in 8.2 did not have a comparison either: https://www.php.net/releases/8.2/en.php#random_extension.
Though one could possibly compare XPath with the new CSS selectors.
</div> | ||
<div class="php8-compare"> | ||
<h2 class="php8-h2" id="new_without_parentheses"> | ||
<?= message('new_without_parentheses_title', $lang) ?> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know that this change has been hyped on social media, but even leaving aside that I don't personally like it, I do not believe that it warrants such a prominent spot in the list of changes. Either #[\Deprecated]
or array_find()
and friends are likely more appealing to list here. Perhaps both of them if HTML 5 + DOM improvements are merged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, Lazy Objects would be more suited to highlight.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this change is noteworthy enough to be included, though I would agree it should be lower on the list than e.g. the new array functions.
$phpVersion = new PhpVersion(); | ||
$foo->version = 'PHP 8.4'; // No error |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$phpVersion = new PhpVersion(); | |
$foo->version = 'PHP 8.4'; // No error | |
$phpVersion = new PhpVersion(); | |
$phpVersion->version = '8.4'; // No error |
$phpVersion = new PhpVersion(); | ||
$foo->version = 'PHP 8.3'; // Visibility error |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$phpVersion = new PhpVersion(); | |
$foo->version = 'PHP 8.3'; // Visibility error | |
$phpVersion = new PhpVersion(); | |
$phpVersion->version = '8.3'; // Visibility error |
<div class="php8-code phpcode"> | ||
<?php highlight_php_trimmed( | ||
<<<'PHP' | ||
class PhpVersion { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opening brace of the class is inconsistent with the other examples.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A big feature of this release is also the dedicated PDO Driver subclasses, IMHO.
'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', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Surely Lazy Objects warrant a highlight compared to this.
I really don't understand what is so revolutionary about not needing to use parentheses with new
.
'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.', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This whole thing is out of date because UPGRADING was not properly organised.
</div> | ||
<div class="php8-compare"> | ||
<h2 class="php8-h2" id="new_without_parentheses"> | ||
<?= message('new_without_parentheses_title', $lang) ?> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, Lazy Objects would be more suited to highlight.
Let's start preparing for the release.
Any help is welcome, especially from RFC authors :)