Fresh selection with links to news and materials. In the release: objects as array keys and other RFC proposals for PHP 8.1, running WebAssembly in PHP, about collisions in arrays, a portion of useful tools, articles, videos, PHP Live Digest .
Enjoy reading!
News and releases
- PHP Russia is postponed to June 28, 2021.
- Results of the Year in the PHP World - Skyeng Community Survey and PHP Digest. Last week to participate.
PHP Internals
- [RFC] Object keys in arrays
.
$obj1 = new stdClass; $obj2 = new stdClass; $array = []; $array[$obj1] = 1; $array[$obj2] = 2; var_dump($array[$obj1]); // int(1) var_dump($array[$obj2]); // int(2)
SplObjectStorage
WeakMap
, . . ,array_*
.
, , , .
, RFC Enumerations . . . - [RFC] Object scoped RNG Implementations
rand()
mt_rand()
(seed)srand()
. - .
API , .
$seed = 1234; $rng = new RNG\MT19937($seed); $array = [1, 2, 3, 4, 5]; shuffle($array, $rng); //
, , , : random_bytes() random_int().
- [RFC] var_representation(): readable alternative to var_export()
var_export()
, , . RFCarray( )
[ ]
.
var_representation($value, int $flags=0) :string
,var_export()
.
brick/varexporter. - [RFC] Change Default mysqli Error Mode
mysqli ( PHPLive#3 ) : . :mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
mysqli CodeIgniter WordPress. - [RFC] Dump results of expressions in `php -a` β
php -a
. - PHP 8.1: What's New and Changed β php.watch , PHP 8.1. RFC - .
- fabpot/local-php-security-checker β composer.json . FriendsOfPHP/security-advisories.
GitHub action Docker- oxcom.
- funivan/PhpClean β PhpStorm, , , , , . .
- wasmerio/wasmer-php β WebAssembly PHP. wasm- PHP. Rust, wasm PHP. . .
- temporalio/sdk-php β PHP-SDK temporal.io β , , , , -.
.. - :#[Workflow\WorkflowInterface] class LoopWorkflow { private array $values = []; private array $result = []; private $simple; public function __construct() { $this->simple = Workflow::newActivityStub( SimpleActivity::class, ActivityOptions::new()->withStartToCloseTimeout(5) ); } #[SignalMethod] public function addValue( string $value ) { $this->values[] = $value; } #[WorkflowMethod(name: 'LoopWorkflow')] public function run( int $count ) { while (true) { yield Workflow::await(fn() => $this->values !== []); $value = array_shift($this->values); $this->result[] = yield $this->simple->echo($value); if (count($this->result) === $count) { break; } } return $this->result; } }
RoadRunner, reactphp/promise, PHP 8. , .
Symfony
- chaos-php/chaos-monkey-symfony-bundle β Chaos Monkey Symfony-. , .
- Symfony: UX β JavaScript Symfony
- Symfony 5.2: PHP 8
- Symfony #734 (18-24 2021)
Laravel
- umbrellio/laravel-pg-extensions β Laravel Postgres.
- fico7489/laravel-eloquent-join β Eloquent.
- artisan.page β Laravel artisan.
- / multitenant Laravel Jetstream β .
- Laravel Github Actions
- 18
- Laravelβ (18β24 2021)
Yii
Async PHP
- walkor/Workerman β API, HTTP, WebSocket, SSL. libevent.
PHP the-benchmarker/web-frameworks, , .
socket.io walkor/phpsocket.io, PSR-7,15,17 chubbyphp/chubbyphp-workerman-request-handler, gotzmann/comet.
- PHP β , , PHP β -, DoS-.
2011 , 2^16 = 65536 PHP 30 0.01 . - php.watch: PHP Curl Security Hardening β cURL PHP .
- Telegram- PHP β beyondcode/expose.
- GitHub GitHub Actions PHP.
- PHP.
- : 30 .
- PHP GitHub Scrutinizer.
- GitHub Actions.
/
- Xdebug 3: Diagnostics β , Xdebug - .
- PhpStorm β , Christoph Rumpel PhpStorm: Mastering PhpStorm.
- Live-coding a Bref Queue β PHP -. Matthieu Napoli, Bref.
- PHP Release Radar #2: PHP 8 β Sara Golemon Gabriel Caruso 8.0, PHP .
- -, PHP.
- PHP 8 β @jrf_nl, , PHP 8 .
, PHP 1997-2017.
Brent Roose , , .
. . , , PHP 8.0TypeError
:
3v4l.org/pU0LDvar_dump(round("foo"));
, , :
3v4l.org/Ln9g3$sub = substr('abcdef', 4, -4); if ($sub === false) { echo 'fail'; } else { echo 'do something with $sub'; } // PHP 5-7 > 'fail' // PHP 8 > 'do something with $sub'
: understandlegacycode.com. - What PHP would look like if it depended on me - A selection of desirable features from Brent Roose: final and void by default, no mixed, parameters and properties must be typed, generics, where can we go without them, enams, objects for scalars.
Today there will be the fourth stream based on PHP Digest. Parsing of news and links from the issue with details and interesting details not included in the text edition. Guest Anton Titov with a story about a new instrument. As well as the results of the drawing and a new competition with elephants.
Beginning at 20:00 Moscow, Minsk / 19:00 Kiev.
If you notice an error or inaccuracy, please let us know in a personal habr or telegram .
More news and comments on the PHP Digest Telegram channel .
Send link
Search for links in all digests
β Previous issue: PHP-Digest β 196