-
Notifications
You must be signed in to change notification settings - Fork 612
Preparing PHP 8.4 announcement page #1079
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
Merged
Merged
Changes from all commits
Commits
Show all changes
61 commits
Select commit
Hold shift + click to select a range
b58da6a
PHP 8.4 page
saundefined 9317e22
Additions for PHP 8.4 page
saundefined d6773f4
Apply suggestions from code review
saundefined b8af9e8
Apply suggestions from code review
saundefined 280b96c
Add PDO Driver specific SQL parsers
saundefined 5ebe198
Apply suggestions from code review
saundefined ab0758a
Fix
saundefined 36d32ed
Update Pdo example
saundefined da3a560
Use LangChooser
saundefined faab6c8
Update releases/8.4/release.inc
saundefined 95d9ae3
Add PHP 8.4 logo image
pronskiy 6b0f763
Add PHP 8.4 share image
saundefined 1ea5cb2
Update New and Deprecated sections
saundefined 6df60c1
Add lazy objects example
saundefined be21b5d
Deprecated attribute instead of Lazy Objects
saundefined 8957d75
Apply suggestions from code review
saundefined c3ca425
Apply suggestions from code review
saundefined 79573e7
Update releases/8.4/languages/en.php
saundefined f2c14bd
Apply suggestions from code review
saundefined 942ce84
Apply suggestions from code review
saundefined 61ed2f3
Apply suggestions from code review
saundefined 9bdc850
Update ext-dom features and HTML5 section
saundefined 3359c81
Update ext-dom features and HTML5 section
saundefined 6c81332
Update Deprecated section
saundefined 4ec6e61
Add Russian translation
saundefined e0ed535
add doc links
saundefined a73d1a7
Apply suggestions from code review
saundefined 3124a4c
Update url
saundefined 74e056f
Update screenshots
saundefined 092c31a
Update messages
saundefined 005eb35
docs: add PHP 8.4 translation to pt_BR.
marcosmarcolin cabc7b0
Merge remote-tracking branch 'upstream/php84' into php84-pt_BR
marcosmarcolin f0fee25
docs: add PHP 8.4 translation to pt_BR.
marcosmarcolin f2bcf89
Add PHP 8.4 translation to pt_BR.
saundefined d672371
Update messages
saundefined d456010
Add dutch translation for 8.4 release page
ndossche 943825a
Add dutch translation for 8.4 release page
saundefined 89412ad
Wording
saundefined c514e47
Wording
saundefined a522b5c
docs: updated 'bc_core' exit() to pt_BR.
marcosmarcolin 06c2d8c
Updated 'bc_core' exit() in pt_BR.
saundefined cab6337
Update releases/8.4/languages/nl.php
saundefined f8cf13d
Add doc links
saundefined de4d025
Add Spanish language support for PHP 8.4 release
andresayac 53bbaa9
Add Spanish language support for PHP 8.4 release
saundefined 1c77f03
Add Spanish to language select
saundefined 789aa28
Apply suggestions from code review
saundefined 49e04bf
Apply suggestions from code review
saundefined b27c386
Apply suggestions from code review
saundefined 15c5253
Add detailed descriptions for new features in Spanish language suppor…
andresayac 2194c34
Add more Spanish descriptions in PHP 8.4
saundefined de6500f
Update Dutch translation for new descriptions
ndossche 8c02cdb
Apply suggestions from code review
saundefined eff384b
Update Dutch translation for new descriptions
saundefined 137c925
Apply suggestions from code review
saundefined ae72aca
Apply suggestions from code review
saundefined 0ccbc5a
Update Russian translation
saundefined cb020e3
Update pt_BR of PHP 8.4
marcosmarcolin 2c8caa5
Update Spanish translation
andresayac 317a4d8
Revert PHP 8.4 changes for layout.inc and index.php
saundefined 4ffd1d3
Apply suggestions from code review
saundefined File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| namespace releases\php84; | ||
|
|
||
| include_once __DIR__ . '/../../include/prepend.inc'; | ||
|
|
||
| const LANGUAGES = [ | ||
| 'en' => 'English', | ||
| 'ru' => 'Russian', | ||
| 'pt_BR' => 'Português do Brasil', | ||
| 'nl' => 'Nederlands', | ||
| 'es' => 'Spanish', | ||
| ]; | ||
|
|
||
| function common_header(string $description): void { | ||
| global $MYSITE; | ||
|
|
||
| $meta_image_path = \htmlspecialchars( | ||
| \filter_var($MYSITE . 'images/php8/php_8_4_released.png', \FILTER_VALIDATE_URL)); | ||
| $meta_description = \htmlspecialchars($description); | ||
|
|
||
| \site_header("PHP 8.4.0 Release Announcement", [ | ||
| 'current' => 'php8', | ||
| 'css' => ['php8.css'], | ||
| 'meta_tags' => <<<META | ||
| <meta name="twitter:card" content="summary_large_image" /> | ||
| <meta name="twitter:site" content="@official_php" /> | ||
| <meta name="twitter:title" content="PHP 8.4 Released" /> | ||
| <meta name="twitter:description" content="{$meta_description}" /> | ||
| <meta name="twitter:creator" content="@official_php" /> | ||
| <meta name="twitter:image:src" content="{$meta_image_path}" /> | ||
|
|
||
| <meta itemprop="name" content="PHP 8.4 Released" /> | ||
| <meta itemprop="description" content="{$meta_description}" /> | ||
| <meta itemprop="image" content="{$meta_image_path}" /> | ||
|
|
||
| <meta property="og:image" content="{$meta_image_path}" /> | ||
| <meta property="og:description" content="{$meta_description}" /> | ||
| META | ||
| ]); | ||
| } | ||
|
|
||
| function language_chooser(string $currentLang): void { | ||
| // Print out the form with all the options | ||
| echo ' | ||
| <form action="" method="get" id="changelang" name="changelang"> | ||
| <fieldset> | ||
| <label for="changelang-langs">Change language:</label> | ||
| <select onchange="location = this.value + \'.php\'" name="lang" id="changelang-langs"> | ||
| '; | ||
|
|
||
| $tab = ' '; | ||
| foreach (LANGUAGES as $lang => $text) { | ||
| $selected = ($lang === $currentLang) ? ' selected="selected"' : ''; | ||
| echo $tab, "<option value='$lang'$selected>$text</option>\n"; | ||
| } | ||
|
|
||
| echo ' </select> | ||
| </fieldset> | ||
| </form> | ||
| '; | ||
| } | ||
|
|
||
| function message($code, $language = 'en') | ||
| { | ||
| $original = require __DIR__ . '/languages/en.php'; | ||
| if (($language !== 'en') && file_exists(__DIR__ . '/languages/' . $language . '.php')) { | ||
| $translation = require __DIR__ . '/languages/' . $language . '.php'; | ||
| } | ||
|
|
||
| return $translation[$code] ?? $original[$code] ?? $code; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| <?php | ||
|
|
||
| $lang = 'en'; | ||
|
|
||
| include_once __DIR__ . '/release.inc'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| <?php | ||
|
|
||
| $lang = 'es'; | ||
|
|
||
| include_once __DIR__ . '/release.inc'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| <?php | ||
|
|
||
| use phpweb\LangChooser; | ||
| use const releases\php84\LANGUAGES; | ||
|
|
||
| $_SERVER['BASE_PAGE'] = 'releases/8.4/index.php'; | ||
| require_once __DIR__ . '/common.php'; | ||
| require_once __DIR__ . '/../../src/autoload.php'; | ||
|
|
||
| $langChooser = new LangChooser(LANGUAGES, [], "", ""); | ||
| [$lang,] = $langChooser->chooseCode("", "", $_SERVER['HTTP_ACCEPT_LANGUAGE']); | ||
|
|
||
| mirror_redirect("/releases/8.4/$lang.php"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| <?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, an updated DOM API, 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, an updated DOM API, performance improvements, bug fixes, and general cleanup.', | ||
| 'upgrade_now' => 'Upgrade to PHP 8.4 now!', | ||
|
|
||
| 'property_hooks_title' => 'Property hooks', | ||
| 'property_hooks_description' => 'Property hooks provide support for computed properties that can natively be understood by IDEs and static analysis tools, without needing to write docblock comments that might go out of sync. Furthermore, they allow reliable pre- or post-processing of values, without needing to check whether a matching getter or setter exists in the class.', | ||
| 'asymmetric_visibility_title' => 'Asymmetric Visibility', | ||
| 'asymmetric_visibility_description' => 'The scope to write to a property may now be controlled independently from the scope to read the property, reducing the need for boilerplate getter methods to expose a property’s value without allowing modification from the outside of a class.', | ||
| 'deprecated_attribute_title' => '<code>#[\Deprecated]</code> Attribute', | ||
| 'deprecated_attribute_description' => 'The new <code>#[\Deprecated]</code> attribute makes PHP’s existing deprecation mechanism available to user-defined functions, methods, and class constants.', | ||
| 'dom_additions_html5_title' => 'New ext-dom features and HTML5 support', | ||
| 'dom_additions_html5_description' => '<p>New DOM API that includes standards-compliant support for parsing HTML5 documents, fixes several long-standing compliance bugs in the behavior of the DOM functionality, and adds several functions to make working with documents more convenient.</p><p>The new DOM API is available within the <code>Dom</code> namespace. Documents using the new DOM API can be created using the <code>Dom\HTMLDocument</code> and <code>Dom\XMLDocument</code> classes.</p>', | ||
| 'new_array_find_title' => 'New <code>array_*()</code> functions', | ||
| 'new_array_find_description' => 'New functions <a href="/manual/en/function.array-find.php"><code>array_find()</code></a>, <a href="/manual/en/function.array-find-key.php"><code>array_find_key()</code></a>, <a href="/manual/en/function.array-any.php"><code>array_any()</code></a>, and <a href="/manual/en/function.array-all.php"><code>array_all()</code></a> are available.', | ||
| 'pdo_driver_specific_parsers_title' => 'PDO Driver specific SQL parsers', | ||
| 'pdo_driver_specific_parsers_description' => 'New subclasses <code>Pdo\Dblib</code>, <code>Pdo\Firebird</code>, <code>Pdo\MySql</code>, <code>Pdo\Odbc</code>, and <code>Pdo\Sqlite</code> of <code>PDO</code> are available.', | ||
| 'new_without_parentheses_title' => '<code>new MyClass()->method()</code> without parentheses', | ||
| 'new_without_parentheses_description' => 'Properties and methods of a newly instantiated object can now be accessed without wrapping the <code>new</code> expression in parenthesis.', | ||
|
|
||
| 'new_classes_title' => 'New Classes, Interfaces, and Functions', | ||
| 'new_jit_implementation' => 'New JIT implementation based on IR Framework', | ||
| 'new_core_functions' => 'New <code>request_parse_body()</code> function.', | ||
| 'new_bcmath_functions' => 'New <code>bcceil()</code>, <code>bcdivmod()</code>, <code>bcfloor()</code>, and <code>bcround()</code> functions.', | ||
saundefined marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| 'new_round_modes' => 'New <code>RoundingMode</code> enum for <code>round()</code> with 4 new rounding modes <code>TowardsZero</code>, <code>AwayFromZero</code>, <code>NegativeInfinity</code>, and <code>PositiveInfinity</code>.', | ||
| 'new_date_functions' => 'New <code>DateTime::createFromTimestamp()</code>, <code>DateTime::getMicrosecond()</code>, <code>DateTime::setMicrosecond()</code>, <code>DateTimeImmutable::createFromTimestamp()</code>, <code>DateTimeImmutable::getMicrosecond()</code>, and <code>DateTimeImmutable::setMicrosecond()</code> methods.', | ||
| 'new_mb_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_getcpu()</code>, <code>pcntl_getcpuaffinity()</code>, <code>pcntl_getqos_class()</code>, <code>pcntl_setns()</code>, and <code>pcntl_waitid()</code> functions.', | ||
| 'new_reflection_functions' => 'New <code>ReflectionClassConstant::isDeprecated()</code>, <code>ReflectionGenerator::isClosed()</code>, and <code>ReflectionProperty::isDynamic()</code> methods.', | ||
| 'new_standard_functions' => 'New <code>http_get_last_response_headers()</code>, <code>http_clear_last_response_headers()</code>, and <code>fpow()</code> functions.', | ||
| 'new_xml_functions' => '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.', | ||
saundefined marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| 'new_grapheme_function' => 'New <code>grapheme_str_split()</code> function.', | ||
|
|
||
| '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.', | ||
saundefined marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| 'bc_zero_raised_to_negative_number' => 'Raising zero to the power of a negative number is now deprecated.', | ||
| 'bc_gmp' => '<code>GMP</code> class is now final.', | ||
saundefined marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| 'bc_round' => 'Passing invalid mode to <code>round()</code> throws <code>ValueError</code>.', | ||
| 'bc_typed_constants' => 'Class constants from extensions <code>date</code>, <code>intl</code>, <code>pdo</code>, <code>reflection</code>, <code>spl</code>, <code>sqlite</code>, <code>xmlreader</code> are typed now.', | ||
| 'bc_mysqli_constants' => '<code>MYSQLI_SET_CHARSET_DIR</code>, <code>MYSQLI_STMT_ATTR_PREFETCH_ROWS</code>, <code>MYSQLI_CURSOR_TYPE_FOR_UPDATE</code>, <code>MYSQLI_CURSOR_TYPE_SCROLLABLE</code>, and <code>MYSQLI_TYPE_INTERVAL</code> constants have been removed.', | ||
| 'bc_mysqli_functions' => '<code>mysqli_ping()</code>, <code>mysqli_kill()</code>, <code>mysqli_refresh()</code> functions, <code>mysqli::ping()</code>, <code>mysqli::kill()</code>, <code>mysqli::refresh()</code> methods, and <code>MYSQLI_REFRESH_*</code> constants have been deprecated.', | ||
| 'bc_standard' => '<code>stream_bucket_make_writeable()</code> and <code>stream_bucket_new()</code> now return an instance of <code>StreamBucket</code> instead of <code>stdClass</code>.', | ||
| 'bc_core' => '<a href="/manual/en/migration84.incompatible.php#migration84.incompatible.core.exit"><code>exit()</code> behavioral change</a>.', | ||
| 'bc_warnings' => '<code>E_STRICT</code> constant has been 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> | ||
| <p>The <a href="/manual/en/migration84.php">migration guide</a> is available in the PHP Manual. Please consult it for a detailed list of new features and backward-incompatible changes.</p>', | ||
| ]; | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.