Skip to content

Commit 636b1db

Browse files
saundefinedTimWollapronskiybukkacookieguru
authored
PHP 8.3 release page (#807)
Co-authored-by: Tim Düsterhus <[email protected]> Co-authored-by: Roman Pronskiy <[email protected]> Co-authored-by: Jakub Zelenka <[email protected]> Co-authored-by: Tim Düsterhus <[email protected]> Co-authored-by: Tim Bond <[email protected]>
1 parent 9609481 commit 636b1db

File tree

9 files changed

+691
-0
lines changed

9 files changed

+691
-0
lines changed

images/php8/logo_php8_3.svg

Lines changed: 9 additions & 0 deletions
Loading

images/php8/php_8_3_released.png

30.1 KB
Loading

releases/8.3/common.php

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
<?php declare(strict_types=1);
2+
3+
namespace releases\php83;
4+
5+
include_once __DIR__ . '/../../include/prepend.inc';
6+
7+
function language_redirect(string $currentLang): void {
8+
// We don't use the general language selection of php.net,
9+
// so soldier on with this one.
10+
return;
11+
}
12+
13+
function common_header(string $description): void {
14+
global $MYSITE;
15+
16+
$meta_image_path = \htmlspecialchars(
17+
\filter_var($MYSITE . 'images/php8/php_8_3_released.png', \FILTER_VALIDATE_URL));
18+
$meta_description = \htmlspecialchars($description);
19+
20+
\site_header("PHP 8.3.0 Release Announcement", [
21+
'current' => 'php8',
22+
'css' => ['php8.css'],
23+
'meta_tags' => <<<META
24+
<meta name="twitter:card" content="summary_large_image" />
25+
<meta name="twitter:site" content="@official_php" />
26+
<meta name="twitter:title" content="PHP 8.3 Released" />
27+
<meta name="twitter:description" content="{$meta_description}" />
28+
<meta name="twitter:creator" content="@official_php" />
29+
<meta name="twitter:image:src" content="{$meta_image_path}" />
30+
31+
<meta itemprop="name" content="PHP 8.3 Released" />
32+
<meta itemprop="description" content="{$meta_description}" />
33+
<meta itemprop="image" content="{$meta_image_path}" />
34+
35+
<meta property="og:image" content="{$meta_image_path}" />
36+
<meta property="og:description" content="{$meta_description}" />
37+
META
38+
]);
39+
}
40+
41+
function language_chooser(string $currentLang): void {
42+
$LANGUAGES = [
43+
'en' => 'English',
44+
'ru' => 'Russian',
45+
];
46+
47+
// Print out the form with all the options
48+
echo '
49+
<form action="" method="get" id="changelang" name="changelang">
50+
<fieldset>
51+
<label for="changelang-langs">Change language:</label>
52+
<select onchange="location = this.value + \'.php\'" name="lang" id="changelang-langs">
53+
';
54+
55+
$tab = ' ';
56+
foreach ($LANGUAGES as $lang => $text) {
57+
$selected = ($lang === $currentLang) ? ' selected="selected"' : '';
58+
echo $tab, "<option value='$lang'$selected>$text</option>\n";
59+
}
60+
61+
echo ' </select>
62+
</fieldset>
63+
</form>
64+
';
65+
}
66+
67+
function message($code, $language = 'en')
68+
{
69+
$original = require __DIR__ . '/languages/en.php';
70+
if (($language !== 'en') && file_exists(__DIR__ . '/languages/' . $language . '.php')) {
71+
$translation = require __DIR__ . '/languages/' . $language . '.php';
72+
}
73+
74+
return $translation[$code] ?? $original[$code] ?? $code;
75+
}

releases/8.3/en.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
3+
$lang = 'en';
4+
5+
include_once __DIR__ . '/release.inc';

releases/8.3/index.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
$_SERVER['BASE_PAGE'] = 'releases/8.3/index.php';
3+
include (__DIR__ . '/../../include/site.inc');
4+
5+
mirror_redirect('/releases/8.3/en.php');

releases/8.3/languages/en.php

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<?php
2+
3+
return [
4+
'common_header' => 'PHP 8.3 is a major update of the PHP language. It contains many new features, such as explicit typing of class constants, deep-cloning of readonly properties and additions to the randomness functionality. As always it also includes performance improvements, bug fixes and general cleanup.',
5+
'documentation' => 'Doc',
6+
'main_title' => 'Released!',
7+
'main_subtitle' => 'PHP 8.3 is a major update of the PHP language.<br class="display-none-md">It contains many new features, such as explicit typing of class constants, deep-cloning of readonly properties and additions to the randomness functionality. As always it also includes performance improvements, bug fixes and general cleanup.',
8+
'upgrade_now' => 'Upgrade to PHP 8.3 now!',
9+
10+
'readonly_title' => 'Deep-cloning of readonly properties',
11+
'readonly_description' => '<code>readonly</code> properties may now be modified once within the magic <code>__clone</code> method to enable deep-cloning of readonly properties.',
12+
'json_validate_title' => 'New <code>json_validate()</code> function',
13+
'json_validate_description' => '<code>json_validate()</code> allows to check if a string is syntactically valid JSON, while being more efficient than <code>json_decode()</code>.',
14+
'typed_class_constants_title' => 'Typed class constants',
15+
'override_title' => 'New <code>#[\Override]</code> attribute',
16+
'override_description' => 'By adding the <code>#[\Override]</code> attribute to a method, PHP will ensure that a method with the same name exists in a parent class or in an implemented interface. Adding the attribute makes it clear that overriding a parent method is intentional and simplifies refactoring, because the removal of an overridden parent method will be detected.',
17+
'randomizer_getbytesfromstring_title' => 'New <code>Randomizer<span style="word-break: break-all;">::</span>getBytesFromString()</code> method',
18+
'randomizer_getbytesfromstring_description' => 'The <a href="/releases/8.2/en.php#random_extension">Random Extension</a> that was added in PHP 8.2 was extended by a new method to generate random strings consisting of specific bytes only. This method allows to easily generate random identifiers, such as domain names, and numeric strings of arbitrary length.',
19+
'randomizer_getfloat_nextfloat_title' => 'New <code>Randomizer::getFloat()</code> and <code>Randomizer::nextFloat()</code> methods',
20+
'randomizer_getfloat_nextfloat_description' => '<p>Due to the limited precision and implicit rounding of floating point numbers, generating an unbiased float lying within a specific interval is non-trivial and the commonly used userland solutions may generate biased results or numbers outside the requested range.</p><p>The Randomizer was also extended with two methods to generate random floats in an unbiased fashion. The <code>Randomizer::getFloat()</code> method uses the γ-section algorithm that was published in <a href="https://doi.org/10.1145/3503512" target="_blank" rel="noopener noreferrer">Drawing Random Floating-Point Numbers from an Interval. Frédéric Goualard, ACM Trans. Model. Comput. Simul., 32:3, 2022.</a></p>',
21+
'dynamic_class_constant_fetch_title' => 'Dynamic class constant fetch',
22+
23+
'new_classes_title' => 'New Classes, Interfaces, and Functions',
24+
'new_dom' => 'New <a href="/manual/en/domelement.getattributenames.php"><code>DOMElement::getAttributeNames()</code></a>, <a href="/manual/en/domelement.insertadjacentelement.php"><code>DOMElement::insertAdjacentElement()</code></a>, <a href="/manual/en/domelement.insertadjacenttext.php"><code>DOMElement::insertAdjacentText()</code></a>, <a href="/manual/en/domelement.toggleattribute.php"><code>DOMElement::toggleAttribute()</code></a>, <a href="/manual/en/domnode.contains.php"><code>DOMNode::contains()</code></a>, <a href="/manual/en/domnode.getrootnode.php"><code>DOMNode::getRootNode()</code></a>, <a href="/manual/en/domnode.isequalnode.php"><code>DOMNode::isEqualNode()</code></a>, <code>DOMNameSpaceNode::contains()</code>, and <a href="/manual/en/domparentnode.replacechildren.php"><code>DOMParentNode::replaceChildren()</code></a> methods.',
25+
'new_intl' => 'New <a href="/manual/en/intlcalendar.setdate.php"><code>IntlCalendar::setDate()</code></a>, <a href="/manual/en/intlcalendar.setdatetime.php"><code>IntlCalendar::setDateTime()</code></a>, <a href="/manual/en/intlgregoriancalendar.createfromdate.php"><code>IntlGregorianCalendar::createFromDate()</code></a>, and <a href="/manual/en/intlgregoriancalendar.createfromdatetime.php"><code>IntlGregorianCalendar::createFromDateTime()</code></a> methods.',
26+
'new_ldap' => 'New <code>ldap_connect_wallet()</code>, and <code>ldap_exop_sync()</code> functions.',
27+
'new_mb_str_pad' => 'New <a href="/manual/en/function.mb-str-pad.php"><code>mb_str_pad()</code></a> function.',
28+
'new_posix' => 'New <a href="/manual/en/function.posix-sysconf.php"><code>posix_sysconf()</code></a>, <a href="/manual/en/function.posix-pathconf.php"><code>posix_pathconf()</code></a>, <a href="/manual/en/function.posix-fpathconf.php"><code>posix_fpathconf()</code></a>, and <a href="/manual/en/function.posix-eaccess.php"><code>posix_eaccess()</code></a> functions.',
29+
'new_reflection' => 'New <a href="/manual/en/reflectionmethod.createfrommethodname.php"><code>ReflectionMethod::createFromMethodName()</code></a> method.',
30+
'new_socket' => 'New <a href="/manual/en/function.socket-atmark.php"><code>socket_atmark()</code></a> function.',
31+
'new_str' => 'New <a href="/manual/en/function.str-increment.php"><code>str_increment()</code></a>, <a href="/manual/en/function.str-decrement.php"><code>str_decrement()</code></a>, and <a href="/manual/en/function.stream-context-set-option.php"><code>stream_context_set_options()</code></a> functions.',
32+
'new_ziparchive' => 'New <a href="/manual/en/ziparchive.getarchiveflag.php"><code>ZipArchive::getArchiveFlag()</code></a> method.',
33+
'new_openssl_ec' => 'Support for generation EC keys with custom EC parameters in OpenSSL extension.',
34+
'new_ini' => 'New INI setting <a href="/manual/en/migration83.other-changes.php#migration83.other-changes.ini"><code>zend.max_allowed_stack_size</code></a> to set the maximum allowed stack size.',
35+
36+
'bc_title' => 'Deprecations and backward compatibility breaks',
37+
'bc_datetime' => 'More Appropriate Date/Time Exceptions.',
38+
'bc_arrays' => 'Assigning a negative index <code>n</code> to an empty array will now make sure that the next index is <code>n + 1</code> instead of <code>0</code>.',
39+
'bc_range' => 'Changes to the <code>range()</code> function.',
40+
'bc_traits' => 'Changes in re-declaration of static properties in traits.',
41+
'bc_umultipledecimalseparators' => 'The <code>U_MULTIPLE_DECIMAL_SEPERATORS</code> constant is deprecated in favor of <code>U_MULTIPLE_DECIMAL_SEPARATORS</code>.',
42+
'bc_mtrand' => 'The <a href="/manual/en/random.constants.php#constant.mt-rand-php"><code>MT_RAND_PHP</code></a> Mt19937 variant is deprecated.',
43+
'bc_reflection' => '<a href="/manual/en/reflectionclass.getstaticproperties.php"><code>ReflectionClass::getStaticProperties()</code></a> is no longer nullable.',
44+
'bc_ini' => 'INI settings <a href="/manual/en/info.configuration.php#ini.assert.active"><code>assert.active</code></a>, <a href="/manual/en/info.configuration.php#ini.assert.bail"><code>assert.bail</code></a>, <a href="/manual/en/info.configuration.php#ini.assert.callback"><code>assert.callback</code></a>, <a href="/manual/en/info.configuration.php#ini.assert.exception"><code>assert.exception</code></a>, and <a href="/manual/en/info.configuration.php#ini.assert.warning"><code>assert.warning</code></a> have been deprecated.',
45+
46+
'footer_title' => 'Better performance, better syntax, improved type safety.',
47+
'footer_description' => '<p>For source downloads of PHP 8.3 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_3">ChangeLog</a>.</p>
48+
<p>The <a href="/manual/en/migration83.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>',
49+
];

0 commit comments

Comments
 (0)