A selection of fresh news and materials from the PHP world. In release: the first alpha of PHP 8.1.0, Composer 2.1, Symfony 5.3, and other releases. An overview of the new proposals for PHP 8.1: Partial Function Application, pipe operator, readonly properties. Plus a portion of useful tools, articles, videos and podcasts.
Enjoy reading!
news
PHP 8.1.0 alpha 1
- PHP 8.1. . 25 .
20 , . :
php.watch/versions/8.1.
PHP 8.0.7, PHP 7.4.20
.
PhpStorm 2021.2
, . , .
: PHP 8.1, Extract Method, .
Composer 2.1.0
reinstall
, . .
packagist.org PHP-
Composer, Jordi Boggiano, PHP.
, packagist.org/php-statistics.
, , , symfony/console/php-stats.
PHP Russia 2021
28 . β , , .
: php_digest.
PHP Internals
[RFC] Partial Function Application
RFC First-class callable syntax.
β ....
,?
β .
:
$func = some_func(...)
β . , .$func = some_func(1, 2, ?, 5)
β , .$func = any_func($all, $params, ...)
β , . , .
[RFC] Pipe Operator v2
, - .
:
array_filter(array_map('strtoupper', str_split(htmlentities("Hello World"))), fn($v) => $v != 'O');
:
$result = "Hello World" |> htmlentities(?) |> str_split(?) |> array_map(strtoupper(?), ?) |> array_filter(?, fn($v) => $v != 'O');
[RFC] Pure intersection types
, . PHP Internals News #88 George Peter Banyard, RFC.
[RFC] Readonly properties 2.0
RFC readonly .
readonly
. .
class Test { public readonly string $prop; public function __construct(string $prop) { // Legal initialization. $this->prop = $prop; } } $test = new Test("foobar"); // Legal read. var_dump($test->prop); // string(6) "foobar" // Illegal reassignment. It does not matter that the assigned value is the same. $test->prop = "foobar"; // Error: Cannot modify readonly property Test::$prop
constructor property promotion PHP 8.0, :
class User { public function __construct( public readonly string $name ) {} } $user = new User('Roman'); echo $user->name; // Ok $user->name = 'Nikita'; // Error
[RFC] Make reflection setAccessible() no-op
,->setAccessible(true)
.
Marco Β«OcramiusΒ» Pivetta ,ReflectionProperty
ReflectionMethod
,setAccessible(true)
.
class Foo { private $bar = 'a'; } (new ReflectionProperty(Foo::class, 'bar'))->getValue();
- nunomaduro/php-interminal β PHP Internals . , .
- joonlabs/php-graphql β PHP- GraphQL. , .
- spiral/attributes β PHP 8 PHP 7.2+ . - nikic/php-parser. SerafimArts.
- spiral/storage β . thephpleague/flysystem API. SerafimArts.
- kalessil/production-dependencies-guar β -
require
composer.json.
«» CI.
Symfony
- Symfony 5.3 β Symfony. PHP Release Radar #11: Symfony 5.3, Nicolas Grekas .
- Symfony Messenger: .
- Symfony AWS Lambda.
- Symfony #754 (7-13 2021).
Laravel
- Laravel 10 β .
- Event Sourcing Laravel β Spatie. .
- Β« Β».
- : Offset Cursor.
- Mohamed Said, core- Laravel: Database Connections in Laravel β Beyond the Basics, What's New in Laravel (#2).
- Larastreamers.com β .
Yii
- Yii 1.1.24 Yii 1 β 2023 .
- yiisoft/rate-limiter β Yii 3.
- PHP : nikic/FastRoute symfony/routing.
- PHP β RFC Short Closures.
- ORDER BY RANDOM().
- static ? β - Beer::PHP.
- PHP .
- , , : .
- PHP : .
/
- PHP Internals News #87 β C .
- PHPTownhall Episode 81: The Book of Psalm - Release of a podcast with Matthew Brown , author of the Psalm.
- Regular digest streams are still on vacation, but there was a great sudden stream based on the spring PHP Digests from Valentin Udaltsov:
Subscribe to the PHP Digest Telegram channel .
If you liked the digest, please give it a plus - this is very motivating to keep doing it.
Did you spot a mistake or typo? Inform in a personal habr or telegram .
You can send the link through the form or simply by writing to me in a telegram .
Search for links in all digests
β Previous issue: PHP-Digest # 204