Neue Auswahl mit Links zu Nachrichten und Materialien. In der Version: Enum in PHP 8.1, Serializable Removal und $ GLOBALS Limitation sowie weitere Neuigkeiten von PHP Internals, PhpStorm 2020.3, Symfony UX, ein Teil nĂŒtzlicher Tools, ein Video und der erste PHP Digest Stream.
Viel SpaĂ beim Lesen!
Nachrichten und Veröffentlichungen
PhpStorm 2020.3 : PHP 8, Attribute, PHPStan und Psalm, Xdebug 3, RĂŒckenwind CSS und Co-Entwicklung.- JetBrains Qodana EAP â JetBrains PhpStorm CI.
- Slack $27 â , PHP, Hack.
- WordPress 5.6 â C - PHP 8.
- PHP â 2020.2 â , Composer packagist.org.
âą PHP 7.4: 42.61% (+22.55)
âą PHP 7.3: 27.05% (-3.00)
âą PHP 7.2: 15.28% (-12.21)
âą PHP 7.1: 7.45% (-4.1)
âą PHP 5.6: 2.71% (-2.28)
âą PHP 7.0: 2.70% (-1.30)
PHP Internals
- [RFC] Deprecate passing null to non-nullable arguments of internal functions â PHP
null
,nullable
. ,str_contains("", null)
, , null .
str_contains("", null); // > No errors function _str_contains ( string $haystack , string $needle ) : bool { return true; } _str_contains("", null); // > Fatal error: Uncaught TypeError: Argument 2 passed to _str_contains() must be of the type string, null given
8.1 deprecation notice.
declare(strict_types=1);
. - [RFC] Restrict $GLOBALS usage â ,
$GLOBALS
,INDIRECT
PHP. PHP.
RFC$GLOBALS
.
, , isset unset:
$GLOBALS['x'] = 1; echo $GLOBALS['x'] isset($GLOBALS['x']); unset($GLOBALS['x']);
.
$GLOBALS :
$GLOBALS = []; $GLOBALS =& $x; $x =& $GLOBALS; unset($GLOBALS);
,$GLOBALS
:
asort($GLOBALS); // > Compile-time error
: : « PHP».
- [RFC] Phasing out Serializable â 7.4 :
Serialiazable
__serialize()
__unserialize()
.
Serializable
. PHP 8.1 deprecation notice, PHP 9.0 â compile-time error. - [RFC] Enumerations â Ilija Tovilo Larry Garfield enum RFC, Swift, Rust, Kotlin.
Enum , â . , , « Enums X» « , ». .
enum
case
:
enum Suit { case Hearts; case Diamonds; case Clubs; case Spades; }
:
$val = Suit::Diamonds; function pick_a_card(Suit $suit) { ... } pick_a_card($val); // OK pick_a_card(Suit::Clubs); // OK pick_a_card('Spades'); // TypeError
Enum -:
$a = Suit::Spades; $b = Suit::Spades; $a === $b; // true $a instanceof Suit; // true $a instanceof Suit::Spades; // true
Enum. , :
enum Suit: string { case Hearts = 'H'; case Diamonds = 'D'; case Clubs = 'C'; case Spades = 'S'; } echo "I hope I draw a " . Suit::Spades; // prints "I hope I draw a S".
Enum , . :
enum UserStatus: string { case Pending = 'pending'; case Active = 'active'; case Suspended = 'suspended'; case CanceledByUser = 'canceled'; public function label(): string { return match($this) { UserStatus::Pending => 'Pending', UserStatus::Active => 'Active', UserStatus::Suspended => 'Suspended', UserStatus::CanceledByUser => 'Canceled by user', }; } } foreach (UserStatus::cases() as $key => $val) { printf('<option value="%s">%s</option>\n', $key, $val->label()); }
:
- case?
- ?
function stuff(Suit::Heart|Suit:Diamond $card) { ... }
- Enum?
- <
enum
? ,Enum
. :enum class UserStatus {...}
- [RFC] Algebraic Data Types â Enum PHP. ** tagged unions pattern matching.
- [RFC] Direct execution opcode file without php source code file â . , -
.pyc / .pyo
.
PHP . ,<?phpo%php_version_id%
.
include()
,include_once()
,require()
,require_once()
. - [RFC] Wall-Clock Time Based Execution Timeout â PHP . sleep() . , ini-
max_execution_time
.
RFCmax_execution_wall_time
, .
- itsgoingd/clockwork v5.0 â Chrome, dev tools PHP-.
PHP. - nicofff/LazyIter â . Rust. .
- veewee/composer-run-parallel â «scripts» composer.json.
- clue/phar-composer â composer.json phar .
- clue/commander â .
- quasilyte/phpgrep 1.0 â PHP- â grep, «» PHP.
Symfony
- Symfony UX â Symfony - npm, Webpack Encore Stimulus js. PHP+JS , Composer: symfony/ux.
- Symfony #728 (7-13 2020)
- Action-Domain-Responder Symfony
- Symfony
Symfony Workshop 2020 â Symfony.
Laravel
- Laravel Sail â CLI- Laravel- Docker.
- tailflow/laravel-orion 1.0 â REST API Eloquent- .
- asantibanez/laravel-eloquent-state-machines â ( ) Eloquent . , .
- lukeraymonddowning/honey â - .
October CMS Laravel 6?
Laravel Internals #2 â Laravel.
Laravel at Scale: Framework, Community & Ecosystem â .
Laravelâ (6â13 2020)
Yii
- Yii 1.1.23 â C PHP 8.
- yiisoft/cookies â Yii 3. - PSR-7.
SOLID . - ActiveQuery Yii2
Async PHP
- clue/reactphp-zenity â Zenity GUI PHP. Ubuntu.
- PHP- â Wikipedia, : wikimedia/php-excimer â wikimedia/arc-lamp â -.
We ingest about 3 million samples daily from a cluster of 150 Apache servers in any given data centre, using a 60s sample interval. These are all received by a single Redis instance.
- AWS Lambda PHP, Docker
- Travis CI GitHub Actions â , Travis CI .
- php.watch: JIT PHP 8
- Faker 2.0 â Faker . Faker.
- PHP Zend
: gRPC- PHP
C++, JS, Python, Python + numba, PHP7, PHP8, Golang â â
Telegram , 1
: ,
MySQL Slack Vitess
«PHP » Matthias Noback . â lex111, PHP.
/
PHP 6.5
EinfĂŒhrung in PHP | Lerne PHP richtig - Ein weiterer Videokurs fĂŒr AnfĂ€nger.
OOP Videokurs in PHP fĂŒr AnfĂ€nger
Schreiben eines Blogs in PHP - und mehr fĂŒr Neulinge.- Was ist neu in PHP 8.0 - Eine detaillierte AufschlĂŒsselung der Neuerungen in PHP.
Unterhaltsam
- Symfony 15th Anniversary Elephant jetzt erhÀltlich
Heute werde ich zum ersten Mal den PHP-Digest streamen. Alle Neuigkeiten und Links aus der Ausgabe + weitere Details, eine Ăbersicht ĂŒber das, was gesendet wurde, interessant, aber nicht in der Ausgabe enthalten, und ein Wettbewerb mit Elefanten.
Ab 20:00 Uhr Moskau, Minsk / 19:00 Uhr Kiew.
Wenn Sie einen Fehler oder eine Ungenauigkeit bemerken, teilen Sie uns dies bitte in einem persönlichen Habr oder Telegramm mit .
Weitere Neuigkeiten und Kommentare zum PHP Digest Telegram-Kanal .
Link senden
Links in allen Digests suchen
â Vorherige Ausgabe: PHP-Digest # 193