PHP Digest # 183 (June 22 - July 5, 2020)

Photo by James Titcumb



Fresh selection with links to news and materials. Everything about PHP 8 in the release: first alpha, new expression match, syntax bug @@for attributes, real JIT benchmarks, 4 new proposals. And, as always, tools, articles, videos and podcasts.



Enjoy reading!



News and releases



  • PHP 8.0 alpha 1 โ€” - PHP! .

    :

    • ;
    • JIT;
    • ;
    • ;
    • mixed.


    PHP 8 . 3v4l.org Docker-.

  • `CurlHandle` class objects replace curl handlers โ€” , PHP resource /. PHP 8 curl_ \CurlHandle.
  • JIT PHP 8 โ€” JIT .



    Derick Rethans , JIT , , C. Brent Roose - .



    Benjamin Eberlei , JIT .
  • โ€” โ€” . 8 .


PHP Internals



  • check [RFC] Shorter Attribute Syntax โ€” @@.



    , , , .



    : function(@@X \ Y $z) function(@@X\Y $z) ( X\Y ) function(@@X \Y $z) ( X \Y ). PHP .



    @@, , [RFC] Treat namespaced names as single token.
  • check [RFC] Match expression v2 โ€” PHP 8 match, switch, .



    //    switch:
    switch ('foo') {
        case 0:
          $result = "Oh no!\n";
          break;
        case 'foo':
          $result = "This is what I expected\n";
          break;
    }
    echo $result;
    //> Oh no!
    
    //     match:
    echo match ('foo') {
        0 => "Oh no!\n",
        'foo' => "This is what I expected\n",
    };
    //> This is what I expected
    
  • [RFC] Allow trailing comma in closure use lists โ€” use , .



    $longArgs_longVars = function (
        $longArgument,
        $longerArgument,
        $muchLongerArgument,  //    PHP 8.0  
    ) use (
        $longVar1,
        $longerVar2,
        $muchLongerVar3  //     
    ) {
       // body
    };
    
  • [RFC] Property write/set visibility โ€” : . :
    // Syntax Option A
    class User {
        public:private int $id;
        public:protected string $name;
    }
    
    // Syntax Option B
    class User {
        public private(set) int $id;
        public protected(set) string $name;
    }
    


    , - , PHP 8.1, RFC, , , , .
  • [RFC] Language Constructs Syntax Changes โ€” declare __halt_compiler โ€” , , echo, .



    declare(strict_types=1);
    // =>
    declare strict_types = 1;
    
  • [RFC] Saner numeric strings โ€” RFC .



    -, ยซ, ยป. echo '2str' + 2; 4, 2 E_NOTICE โ€œA non well formed numeric value encounteredโ€ E_WARNING โ€œA non-numeric value encounteredโ€.



    -, , "123 " == " 123" true , .




  • Guzzle 7 โ€” HTTP- PHP. PSR-18, PHP 7.2, .
  • deligoez/xDebug-Toggler โ€” macOS / Xdebug.
  • denisyukphp/tmpfile-manager โ€” . , , . @jebox.
  • php-aidc/label-printer โ€” Fingerprint, Direct Protocol, TSPL/TSPL2. jhaoda.


Symfony



  • EasyAdmin 3 โ€” Symfony-.
  • ferrius/ddd-cqrs-example โ€” CQRS, DDD, ADR Symfony 5 PHP 7.4.
  • Symfony #705 (29 โ€” 5 2020)
  • habr 10 Symfony.
  • habr [Symfony 5] .
  • habr ACL Symfony.


Laravel



  • Laravel Worldwide Meetup โ€” - Laravel 14 21:00 UTC+3.
  • dollar Laravel Idea 3.1 โ€” PhpStorm Livewire nWidart/laravel-modules.
  • scil/LaravelFly โ€” Laravel Swoole. , PHP-FPM Swoole. .
  • habr N+1 Laravel.
  • habr Laravel- (29 โ€“ 5 2020)
  • Laravel:


Async PHP



  • amphp/websocket-server 2.0 โ€” Amp.
  • clue/reactphp-buzz โ€” HTTP-.




  • โ€” , memory_get_usage() .
  • PHP FFI .
  • 0xbigshaq/php7-internals โ€” PHP, .
  • 2025?
  • max_execution_time?
  • Xdebug PhpStorm Symfony.
  • habr PHP- Xdebug PhpStorm.
  • habr , , .
  • habr , - ?


/



  • video Xdebug, PhpStorm Laravel Docker โ€” Xdebug Derick Rethans.
  • videoru PHP: PhpStorm macOS Metal.
  • videoru PHP: 25 PHP โ€” .
  • videoru PHP fwdays 2020
  • videoru -: , , .
  • videoru MoreView #11 โ€” , PHP, JetBrains.
  • videoru OpenSource, Yii 3 .
  • video Serverless Chats Podcast #55 โ€” C Mathew Napoli Bref PHP.
  • audio PHP Internals News #60 โ€” C Eliot Lear RFC-5652 PHP 8.
  • audio PHP Internals News #59 โ€” C , PHP 8.


Thanks for your attention!



If you notice a mistake or inaccuracy - please inform me in PM .

Questions and suggestions write to mail or twitter .



More news and comments on the PHP Digest Telegram channel .



Send link

Search links in all digests

โ† Previous issue: PHP-Digest โ„– 182




All Articles