Nouvelle sélection avec des liens vers des nouvelles et des documents. Dans le numéro: 5 nouveaux RFC de PHP Internals, ainsi qu'une proposition pour développer le langage et quelques prototypes de nouvelles fonctionnalités sous forme de requêtes de pool, une partie d'outils utiles, des vidéos, des podcasts et bien plus encore.
Bonne lecture!
Nouvelles et communiqués
- PHP 7.4.3 - Cette fois, ils corrigeaient toujours des bogues en utilisant
opcache.preload_user
et maintenant le préchargement peut être activé en production. - PHP 7.3.15
- PHP 7.2.28
- :
• -, 28 13 : SymCode-, TBA
• --, 29 : 3- PHP-
• , 12 : BeerPHP
• , 14 : 3- PHP-
• , 26 : 3- PHP-
• , 28 : 2- PHP-
• skyeng/php-communities — PHP-, .
• PHP fwdays'20, , 30 — ! 15%: PHPDIGEST2020.
PHP Internals
- Language evolution — , PHP , . , -.
- : [RFC] Variable Syntax Tweaks, [RFC] Static return type, [RFC] Allow ::class on objects
- [RFC] Write-Once Properties — , , . , :
final
, immutable
, readonly
, writeonce
, locked
, sealed
.class Foo
{
<keyword> public int $a = 1;
<keyword> public string $b;
<keyword> public array $c = ["foo"];
<keyword> public object $d;
public function __construct()
{
$this->b = "foo";
}
}
$foo = new Foo();
$foo->a = 42;
$foo->b = "bar";
$foo->a++;
unset($foo->c);
$foo->c[] = "bar";
$var= &$this->c;
$foo->d = new Foo();
$foo->d->foo = "foo";
. , , , , , . - [RFC] str_contains —
str_contains(string $haystack , string $needle) :bool
, , strpos()
strstr()
. - [RFC] Object-based token_get_all() alternative —
token_get_all()
, PhpToken
. - [RFC] get_debug_type — :
gettype()
get_class()
. - [RFC] Allow explicit call-site pass-by-reference annotation — RFC . . , . , .
declare(require_explicit_send_by_ref=1);
function byRef(&$ref) {...}
byRef(&$var);
- [Pre-RFC] Add support for «decorator» pattern — «» PHP.
interface Foo {
public function method1(int $a): void;
public function method2(): int;
public function method3(string $b): string;
public function method4(): stdClass;
}
class ComposedFoo implements Foo {
private decorated Foo $inner;
public function __construct(Foo $inner) { $this->inner = $inner; }
public function method4(): stdClass {
return $DO_SOMETHING_DIFFERENT_HERE;
}
}
- [PR] Use serialize_precision for printing floats in var_dump() — ,
float
var_dump()
(0.1 + 0.2 === 0.30000000000000004):
$sum = 0.1 + 0.2;
var_dump($sum);
var_dump($sum == 0.3);
$sum = 0.1 + 0.2;
var_dump($sum);
var_dump($sum == 0.3);

Symfony
Laravel
Yii
Async PHP

/
!
— , , .
.
Telegram- PHP Digest.
— GitHub.
← : PHP- № 173