The PHP development team announces the immediate availability of PHP 8.2.0.
This release marks the latest minor release of the PHP language.
PHP 8.2 comes with numerous improvements and new features, such as:
- Readonly classes
- Disjunctive Normal Form (DNF) Types
- New stand-alone types: null, false, and true
- New "Random" extension
- Constants in traits
- Deprecate dynamic properties
For source downloads of PHP 8.2.0 please visit our downloads page
(https://www.php.net/downloads.php), Windows source and binaries can be
found on https://windows.php.net/download/.
The list of changes is recorded in the ChangeLog
(https://www.php.net/ChangeLog-8.php#8.2.0).
The migration guide (https://php.net/manual/en/migration82.php) is available
in the PHP Manual.
Please consult it for the detailed list of new features and backward
incompatible changes.
Kudos to all the contributors and supporters!
Release Manifest here and below:
https://gist.github.com/saundefined/aa15978ea1add1bb40e83f302409e557
Regards,
Pierrick Charron, Sergey Panteleev & Ben Ramsey
php-8.2.0.tar.bz2
SHA256 hash: 1bf4fca663f93d9e0b4909bd6eae0583a1ce383e7f05df126f28f272fa1fd51a
PGP signature:
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEE5gkT5N8gmQfY4w2WZZqXyc8qeVoFAmOPUcMACgkQZZqXyc8q
eVoaQBAArfI1clbS+oSKBMgcYApTZEVDOjhbJ+HeHRcCSNSAbStN1zWNYAeZBtP+
UdaOSIKp8WTG1YPtMc+oCA6yq7+rir8zUTq5ttfBc160HZTDDNnBzz+qDe8PvEwI
Ps+h8kiXSxL16qHIU8hIXbXvoYllvs57ljuMqig1kNUzAmACS9AJjf+Pq+wsZv3a
p1p/oG7YBEqQXoInGv3/ZD9M3gClR90VtOAo+sOR3m3qIbUSdJfPZ/pXHhIQAhZZ
R+rhQQypd9PH9rJ8RPeeTQw+Ekrh5r+QROse9ONvJG2az2rZOwWNeDYbaB48Oqyw
/opkYkI1uB0siqnYon/A6iKKvzIIG2sMOiiE8TVVzxEe0x7u8x96hlO1BupaIYiD
0j5BOuXP6g7q7+kWfx4jxMu3cTXh6GfUqt6qwEOaZxlgOMcSlMwur7EPyXJE8u35
3LNYkqbcg7YqcYWZMUyjMbPI7FmnA3f1yOP+7DFLJR5UgrRwYYjvpO9k7G9Q8vc/
pLun2CHMZyxZ2kQq2rfk1qBTGoyzi1CwsRS82NO6fwR/TggMP8e0g2d2QTIbWLjf
nXwGt6rlJInGXs/fpbDTGe/Pr6bTE3P/GZqzY1pS0Z/YD42K2GKXNCVccWq8CIXJ
9mjqYFHz2ozm4fuAPNCr4iTQTvlsew+UHXn57TxBlJyp5MNtTz8=
=8udX
-----END PGP SIGNATURE-----
php-8.2.0.tar.gz
SHA256 hash: 435c4c2439db648cdf34236f7cd459f93f943fb788b66723a033610d4a059fc6
PGP signature:
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEE5gkT5N8gmQfY4w2WZZqXyc8qeVoFAmOPUcQACgkQZZqXyc8q
eVo13A//cTGhB+GDpXLpP8/HwysnPVz3MLaq/RGlIESz7HZDickHamLZXXH7F6RM
Jjz+wZkfrYFhxbdvul2x6tgyIrBaItIHghDOzv7bIpho2Nz+jUXNADVvbri9ps2m
nu6Ift/7B7OpXtbSLoDJUOwtXO7eUX6zIbhT3x/zDW3mgaumo1Mw1hERecNTkMys
1SvaQyyziQMzRcx3PSon/YqLRgjMaT5pnZr3RjMNwhlcmQnuWd61HQT5Kb6UOGY5
wjnnlhsuUm5h7TCA4Uk4iWXvE7pWV0kmxoAFN4vEq2BPK644A/LnWM/JzMcbqv0k
LgQusG04h7MYqIFhN00bcQenwHoAN0xfYQ9jFURfFR8s1fwVIaVxc42rankWHjYF
9lLF8XAgdXoY+V718LxQA7d8SS4b2dRNMOLnOEw/G34dJcJfihtygexwK1l72y7h
YN1jqCcWKgIH+ZJOZnpqal21fkgObkhOz2gi64adkur/a542+9Kds2YXgFnOoayP
HMKWTy21csypub+93g62KMd2fIWPKaSkuEYiXPiAm25Ww0g5AdujvcdqVDfFQjsN
AUU52Phjw4cLM9JxqyKXpm+NQLHRbfIKOxI/TH1u8zzoTnKH/29iXhgP0KQ4jZ9y
vfH5qjT0BKEZN9vFVY6/gm7O319XHyeEyFHt2qLxSVgyqEQwBeY=
=j2zy
-----END PGP SIGNATURE-----
php-8.2.0.tar.xz
SHA256 hash: 6ea4c2dfb532950fd712aa2a08c1412a6a81cd1334dd0b0bf88a8e44c2b3a943
PGP signature:
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEE5gkT5N8gmQfY4w2WZZqXyc8qeVoFAmOPUcQACgkQZZqXyc8q
eVpnjA/+K+PLYpl8T9zwOG7ewv0C0vPMQsSH+7mvAtZVk1uD71S+IxzGTSCrO2tB
4vHKfQEM4vIE2vhUgYy6xaquAroxBfcFWIZ0XJHHXuveLMyPv0yoY74D61m6ex4A
Q9sMnug8wI0e2/gnFPk+bO5JLjBVUKMiwaR9fU2WjSmpehns2efcv9SopVrSwkxW
aFM38xhzokYiwgEoNEU7ig0F/GVgNriXmV1xn1kaYOV4V5oU3mKKYpBQWl6+2KJt
g9tdJF8kOI4jiBs9oRUTUiC8lhHowwnVZncklPoNi38l7vCROV5iYwQAmhHgZ9G9
y2ALB8zPYk10FyLJw2FQgaxO0W9HZiVvSZ1DMVe9dbvYR6uebr+r7ZtRS80SgfN1
ZdwLBXjwfNidH7ANvVwVHnZdWPYWkuXXmqoh0dLAeyeI8E7G5KSR3vZnLJI+v/5V
cz6OP1gUYvr8YlXAxMu3jhObYeilmwkvabn6szAW1fmb4vyI0pKIeDpQvwFBoj+1
1eeFpXxlzncEUYJe+Ck871tVKRJXfCySbQkprHZsjBK2BjZH/ghEk0u1RLuwPO/a
6Hu9zjadhe+Vb9tFtbP8w3THlp/w1k8r95H71k3cvxzQsBqibuLFSf+X5chXMn4I
Rx90L2diL+34FSKzEqV1FpWw4vOKWDLVTkR4/l2cO6lV+OqzO9M=
=pwa0
-----END PGP SIGNATURE
I think in this example the check for null can be removed.
The feature is so much more useful than presented here.
(https://www.php.net/releases/8.2/en.php#dnf_types)
class Foo {
public function bar((A&B)|null $entity) {
- if ($entity === null) {
- return null;
- }
return $entity;
}
}
Best regards
Thomas Gutbier
On Thu, Dec 8, 2022 at 1:39 PM Thomas Gutbier
thomas.gutbier@anthrotec.de wrote:
I think in this example the check for null can be removed.
The feature is so much more useful than presented here.(https://www.php.net/releases/8.2/en.php#dnf_types)
class Foo { public function bar((A&B)|null $entity) {
if ($entity === null) {
return null;
}} return $entity; }
Best regards
Thomas Gutbier--
To unsubscribe, visit: https://www.php.net/unsub.php
I'd also like to point out that this doesn't cause a fatal error, at
least in the latest RC (I haven't tried the official release yet).
trait Foo
{
public const CONSTANT = 1;
public function bar(): int
{
return self::CONSTANT; // Fatal error
}
}
class Bar
{
use Foo;
}
var_dump(Bar::CONSTANT); // 1
var_dump((new Bar)->bar()); // 1
On Thu, Dec 8, 2022 at 1:39 PM Thomas Gutbier
thomas.gutbier@anthrotec.de wrote:I think in this example the check for null can be removed.
The feature is so much more useful than presented here.(https://www.php.net/releases/8.2/en.php#dnf_types)
class Foo { public function bar((A&B)|null $entity) {
if ($entity === null) {
return null;
}} return $entity; }
I think accordingly there should only be a single if-statement in the
PHP < 8.2 code sample.
I'd also like to point out that this doesn't cause a fatal error, at
least in the latest RC (I haven't tried the official release yet).trait Foo
{
public const CONSTANT = 1;public function bar(): int { return self::CONSTANT; // Fatal error }
}
class Bar
{
use Foo;
}var_dump(Bar::CONSTANT); // 1
var_dump((new Bar)->bar()); // 1
Indeed, this example is borked. There is no fatal error at this place
prior to PHP 8.2.0 either; rather, line 5 raises a fatal error ("Traits
cannot have constants").
--
Christoph M. Becker