Fresh selection with links to news and materials. In the issue: 5 new RFCs from PHP Internals, as well as a proposal for developing the language and a couple of prototypes of new features in the form of pool requests, a portion of useful tools, videos, podcasts and much more.
Enjoy reading!
News and Releases
- PHP 7.4.3 - This time they still fixed bugs using
opcache.preload_user
and now preload can be enabled in 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