Pilihan baru dengan tautan ke berita dan materi. Dalam Rilis: Objek di Penginisialisasi, Ruang Nama Ekstensi, dan Saran RFC Lainnya untuk PHP 8.1. Memperbarui PSR-11, mengusulkan Antarmuka Jam PSR. Sebagian dari alat, video, podcast, artikel, dan PHP Digest Live yang bermanfaat pada pukul 20:00 GMT.
Selamat membaca!
Berita dan rilis
- PHP 8.0.3 , PHP 7.4.16 .
- PSR ClockInterface
, , .
:
namespace Psr\Clock; interface ClockInterface { /** * Returns the current time as a DateTimeImmutable Object */ public function now(): \DateTimeImmutable; }
- PSR-11 Container Interface β , 1.1, , 2.0 β .
- Git clone β . Git 2.30.2.
- PhpStorm 2021.1 EAP β : PHP- , JSONPath
. , EAP . - Composer 1.x β 2021 API packagist.org .
PHP Internals
- [RFC] New in initializers
PHP , , , . , , β . .
, , .
static $x = new Foo(); const C = new Foo(); #[AnAttribute(new Foo())] class Test { public const C = new Foo(); public static $prop = new Foo(); public $prop = new Foo(); public function __construct( private Logger $logger = new NullLogger() ) {} } function test($param = new Foo()) {}
new
, .
. , , , , , . PHP Live.
- [RFC] Namespaces in bundled PHP extensions
, PHP, . .
RFC , PHP. .OpenSSLCertificate
OpenSSL\Certificate
.
, , RFC . :
str_contains()
->String\contains()
in_array()
->Array\contains()
.
PHP 9. - [RFC] Static variables in inherited methods
, , . , .
RFC , .
class A { public static function counter() { static $i = 0; return ++$i; } } class B extends A {} var_dump(A::counter()); // int(1) var_dump(A::counter()); // int(2) var_dump(B::counter()); // int(3) var_dump(B::counter()); // int(4)
- [RFC] Fibers
. , . : , , PHP . , :
Swoole. , Swoole PHP, β , .
Joe Watkins, , /. krakjoe/parallel .
, , β , Swoole parallel. - [RFC] noreturn type
Psalm PHPStan PHP βnoreturn
.
, ,exit()
,die()
,trigger_error()
.
function redirect(string $uri): noreturn { header('Location: ' . $uri); exit(); } function redirectToLoginPage(): noreturn { redirect('/login'); }
Hack, Python, Psalm, PHPStan PhpStorm#[NoReturn]
exitpoint .phpstormmeta.php. - [RFC] debug_backtrace_depth(int $limit=0): int β debug_backtrace_depth(int $limit=0), . , .
:count(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, $limit=0))
. - [RFC] println(string $data = ''): int β
println
,stdout
.str_contains()
, , .
- spiral/RoadRunner v2.0.0 β PHP Golang.
- QratorLabs/Smocky β runkit7 mock- PHPUnit .
- markdown.
- phpize.online β PHP- 3v4l.org SQL.
Symfony
- symfony/runtime β PHP-FPM, CLI, PHP-PM, Swoole . .
- Symfony 6 PHP 8.0
- ansien/RapidFormBundle β Symfony, PHP 8.
- Symfony
- Symfony Docker
- CI/CD Symfony GitLab
- Symfony #741 (8-14 2021)
Laravel
- RCE Laravel <= v8.4.2 debug mode β
file_get_contents
/file_put_contents
FTP. facade/ignition. - Laravel 7 β LTS 2022.
- spatie/laravel-remote β Artisan spatie/ssh.
Freek Van der Herten, c . - squirephp/squire β Eloquent ( , , .).
- Laravel
Laravelβ (22 β 7 2021)
Yii
- FFI PHP
- PHP.Watch: PHP.
- PHP β .
- Matthias Noback: β ? β , .
- PHP arm64 vs x86_64 β AWS ARM 20% .
- nginx+fpm Swoole PHP API 91% β github.com/appwrite.
- PHP Xdebug 3, Docker Compose PhpStorm.
- CI Laminas β GitHub Actions , 200+ .
- β .
Run, config, run: Badoo
1-:
,
PHP- β , , .
: PHP
: ! PHP.- PHP Release Radar #6: Bref 1.0 β C Matthieu Napoli.
- PHP Internals News #77 β PHP 8.1 fsync David Gebler.
- PHP Internals News #78 β C Andreas Heigl PHP Git. , , PHP Russia.
PHP β87: PHP 2021
PHP β86: PHP 8
12: β
Setelah istirahat sejenak, kami kembali dengan aliran dan presenter Valentin Udaltsov!
Akan ada penguraian berita dan tautan dari masalah dengan detail dan detail, pendapat Valentine tentang RFC dan artikel. Menarik tetapi tidak termasuk dalam masalah, hasil pengundian dan kompetisi baru dengan gajah.
Mulai pukul 20:00 Moskow, Minsk / 19:00 Kiev.
Jika Anda melihat kesalahan atau ketidakakuratan, harap beri tahu kami melalui habr atau telegram pribadi .
Lebih banyak berita dan komentar di saluran Telegram PHP Digest .
Kirim tautan
Cari tautan di semua intisari
β Masalah sebelumnya: PHP-Digest # 199