PHP Annotated Monthly – May 2019

PHP Annotated Monthly

Greetings everyone,

Please welcome the May edition of PHP Annotated Monthly. Inside we have all the latest news and material from the world of PHP. Read all about the PHP updates, Codeception, WordPress, and other releases. PHP 7.4 is shaping up with a few new RFC proposals accepted including arrow functions, Zend Framework becomes Laminas, news from Laravel, Yii, and Symfony, some async PHP stuff, useful tools, and a whole lot more!

⚡️ News & Releases

🐘 PHP Internals

  • [RFC] Arrow Functions 2.0 — The proposal has passed the vote and is now accepted! We’ll get short closures in PHP 7.4. The original syntax fn() => is used and it also has automatic scope binding by value: So far arrow functions can only have a single statement. Multiline functions are part of the future scope and may be implemented later. The hack with the && operator, like you can do in JavaScript, will not work: But it is possible to do a workaround with array functions:
  • [RFC] Deprecate PHP Short open tags — The proposal considered eliminating the tags <?, but it faced a wave of resentment and arguments. And although it was accepted, it looks like the deprecation will be postponed.
  • [RFC] Spread Operator in Array Expression — Almost unanimous voting makes it possible to use the ... operator in arrays. Also it can help convert an iterator to an array instead of using iterator_to_array:
  • [RFC] Allow throwing exceptions from __toString() — Nikita continues fixing “PHP Sadnesses” one by one. He is working on an old issue of throwing exceptions in a __toString(). Another useful and not trivial improvement for PHP 7.4, which will save us from using workarounds like 1, 2.
  • [RFC] Deprecate left-associative ternary operator — Almost all programming languages have the ternary operator calculated from right to left, but this is different in PHP it was a potential source of bugs. The proposal to deprecate left associativity is now accepted, and if a nested ternary is needed then the precedence should be explicitly declared with brackets.
  • With all the accepted RFC’s PHP 7.4 is going to be amazing! Read a nice recap on what’s New in PHP 7.4.
  • Derick Rethans has recorded a whole load of new episodes of PHP Internals News:
    • 🔈 #6 — On PHP and extensions quality with Remi Collet.
    • 🔈 #7 — On JIT in PHP 8 and earlier attempts with Zeev Suraski.
    • 🔈 #8 — On Short tags with George Banyard.
    • 🔈 #9 — On bundled extensions with Kalle Nielsen.

🛠 Tools

Symfony

Laravel

Yii

🌀 Async PHP

💡 Misc

🎥 Audio & Video

Thanks for reading!

If you have any interesting links to share via PHP Annotated Monthly, please leave a comment or drop me a message on Twitter.

Subscribe to PHP Annotated

Your JetBrains PhpStorm Team
The Drive to Develop

This entry was posted in PHP Annotated Monthly and tagged , , , , , , , , . Bookmark the permalink.
  • They See Me Not

    is this copy of habr article?

    • http://pronskiy.com Roman Pronskiy

      Kind of reworked mix of couple of them cause I post to habr more frequently.

  • http://moelleken.org/ Lars Moelleken

    If someone search for a fast string-lib alternative to “Stringy” maybe you are interesting in this repo. 100% compatible with the original “Stringy” library, but this fork is optimized for performance and is using PHP 7+ features.

    https://github.com/voku/Stringy

    Happy Coding :)