Nova seleção com links para notícias e materiais. No release: cronograma de lançamento do PHP 8, análise da ergonomia de objetos no PHP e 5 RFCs recentes do PHP Internals, algumas ferramentas úteis, vídeos, podcasts e muito mais.
Gostar de ler!
 Internos em PHP
 Internos em PHP
- Agenda de liberação do PHP publicada 8 - O primeiro alfa é esperado em 18 de junho e a versão final em 3 de dezembro. Mais detalhes .
- [RFC] Constructor Property Promotion — PHP, , 3 RFC: Constructor Promotion, Named parameters, Compound Property Visibility ( {public get, private set}).
 
 , RFC :
 
 class Point {
    public float $x;
    public float $y;
    public float $z;
    public function __construct(
        float $x = 0.0,
        float $y = 0.0,
        float $z = 0.0
    ) {
        $this->x = $x;
        $this->y = $y;
        $this->z = $z;
    }
}
 
 :
 
 class Point {
    public function __construct(
        public float $x = 0.0,
        public float $y = 0.0,
        public float $z = 0.0
    ) {}
}
 
- [RFC] Allow trailing comma in parameter list — , . PHP 7.3.
 
 class Uri {
    private function __construct(
        ?string $scheme,
        ?string $user,
        ?string $pass,
        ?string $host,
        ?int $port,
        string $path,
        ?string $query,
        ?string $fragment // <-- ARGH!
    ) {
        ...
    }
}
 
- [RFC] Stricter type checks for arithmetic/bitwise operators — RFC TypeError, , .
 
 var_dump([] % [42]);
 
- [RFC] Switch expression — switch, :
 
 $expressionResult = switch ($condition) {
    1 => foo(),
    2 => bar(),
    3, 4, 5 => baz(),
};
 
 RFCcase:case 3, 4, 5: break;case 3: case 4: case 5: break;.
- [RFC] Type casting in array destructuring expressions — :
 
 [(int) $now, (int) $future] = ["2020", "2021"];
[$now, $future] = ["2020", "2021"];
$now = (int) $now;
$future = (int) $future;
 
 , :
 
 ...[int $i] = ['a' => '123'];
function foo(...[int $i]) {
}
foo(['a' => '234']);
 
 :
 
 $var = (Foo) [
    'a' => 123,
    'b' => (Bar) [
        'c' => 
    ],
];
 
- : Server-Side Request and Response Objects, Userspace operator overloading, Write-Once (readonly) Properties.

 Symfony
 Symfony
 Laravel
 Laravel
 Yii
 Yii

 /
 /
Obrigado pela atenção!
Se você perceber um erro ou imprecisão - informe-me no PM .
Perguntas e sugestões escreva para o correio ou twitter .
Mais notícias e comentários no canal PHP Digest Telegram .
Enviar link
Pesquisar links para todos os resumos
← Versão anterior: PHP Digest No. 176