Nueva selección con enlaces a noticias y materiales. En este número: Fibras para PHP asincrónico, primeros atributos nativos, short match y otras propuestas RFC para PHP 8.1, herramientas, muchos videos, artículos y podcasts.
¡Feliz lectura y próspero año nuevo!
Internos de PHP
- [RFC] Fibras - Una gran propuesta para PHP asincrónico. Más detalles estaban en el canal de Telegram . En definitiva, se trata de una versión mejorada de generadores, que te permitirá escribir código asincrónico basado en bibliotecas como ReactPHP / Amp mucho más fácil y comprensible.
Amp v3 aún está en desarrollo, pero ya usa fibras en lugar de promesas. Aquí hay un ejemplo de cómo se ve el análogo async / await:use Amp\Delayed; use Amp\Loop; use function Amp\async; use function Amp\await; // , int , , . $callback = function (int $id): int { return await(new Delayed(1000, $id)); // Await promise resolution. }; // $callback int, but is executed asynchronously. $result = $callback(1); // , 1 . \var_dump($result); // , . $result = await([ // , 1 . async($callback, 2), async($callback, 3), ]); \var_dump($result); // 2 .
- [RFC] #[Deprecated] Attribute — PHP 8 , . —
#[Deprecated]
. ,#[Deprecated]
, PHPE_DEPRECATED
.
, , .
, PhpStorm 2020.3. , . , - final, . - [RFC] #[NamedParameterAlias] Attribute — PHP 8.1.
, — . , API .
RFC: Named Parameters explicit opt in.
— , , .<?php use NamedParameterAlias; // Old function signature: function log($arg1) {} // New function signature introduces better name function log(#[NamedParameterAlias("arg1")] $message) {} log(arg1: "Hello World!"); log(message: "Hello World!");
Attribute::IS_REPEATABLE
. , . - [RFC] Short match —
match
PHP 8switch
.
switch(true) { ...
,if-elseif-...else
.match(true)
.
RFCmatch
match(true)
.
«».PHP 8.0: $a = 3; print match (true) { $a < 2 => 'small', $a == 3 => 'medium', default => 'large', };
: $a = 3; print match { $a < 2 => 'small', $a == 3 => 'medium', default => 'large', };
- [RFC] Configurable callback to dump results of expressions in `php -a` — Tyson Andre
php -a
.
bobthecow/psysh, PHP . . - [RFC] Add is_list(mixed $value): bool — RFC Tyson Andre.
is_list()
,true
,0, 1, 2 ... count($value)-1
.
- [PR] Add support for property initialization during cloning — - .
class Foo { public $bar; public $baz; public function withProperties($bar, $baz) { $self = clone $this; $self->bar = $bar; $self->baz = $baz; return $self; } } class Foo { public $bar; public $baz; public function withProperties($bar, $baz) { return clone $this with { bar: $bar, baz: $baz, }; } }
- Rector 0.9 — , , PHP 8.
- FriendsOfPHP/proxy-manager-lts — Ocramius/ProxyManager/ PHP >=7.1.
- fullpipe/check-them — . fullpipe1.
- multiavatar/multiavatar-php — (). 'php':

- dantleech/maestro2 — PHP- — ansible PHP . GitHub Actions. .
- matomo-org/matomo 4.0 — Google Analytics PHP. Piwik.
- jolicode/JoliNotif — PHP-. Win, macOS, Linux.
- skrtdev/NovaGram — API -.
Symfony
Laravel
- Laravel
- Blackfire Laravel Vapor
Laravel,
Freek Murzee,
Laravel Internals #3 — Laravel .
Laravel Snippet #24: Fortify, Jetstream, Breeze
Yii
- Yii 2.0.40
- yiisoft/test-support — , PSR-.
- , PHP — Matt Brown, Psalm, PHP Vimeo.
- – , — GitHub Git.
- Flysystem 2.0 .
Magento 2
- PHP 8
Xdebug 2 Xdebug 3

PHP — ? 1 (), 2 ()
: 
: PHP- []
PHP : , , []
Highload PHP Redis ( , ManyChat).
PHP 8 — . PHP .
Revisión de código PHP: upload-to-s3-webhook - Revisión de código público por Mathew Napoli, autor de Bref .
Acerca de los modos de operación en Xdebug 3 - Video del autor de Xdebug sobre la configuración del depurador / generador de perfiles / recopilador de cobertura.
Entretenido
- elephpant PHP8: Nace InPHPinity - El nuevo elefante PHP 8 está disponible para pre-pedido:

Hoy habrá el segundo flujo de PHP Digest. Todas las novedades y enlaces del número + más detalles, un resumen de lo enviado, interesante pero no incluido en el número, los resultados del dibujo y un nuevo concurso con elefantes.
A partir de las 20:00 Moscú, Minsk / 19:00 Kiev.
Encuesta: Resumiendo PHP Year y Playing the Elephant
Si observa un error o inexactitud, háganoslo saber en un habr o telegrama personal .
Más noticias y comentarios en el canal PHP Digest Telegram .
Enviar enlace
Buscar enlaces en todos los resúmenes
← Número anterior: PHP Digest # 194