PHP Digest # 183 (22 Juni - 5 Juli 2020)

Foto oleh James Titcumb



Seleksi segar dengan tautan ke berita dan bahan. Segala sesuatu tentang PHP 8 dalam rilis: alfa pertama, ekspresi baru match, bug sintaksis @@untuk atribut, tolok ukur JIT nyata, 4 proposal baru. Dan, seperti biasa, alat, artikel, video, dan podcast.



Selamat membaca!



Berita dan rilis



  • 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



  • memeriksa [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.
  • memeriksa [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.
  • dolar 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.


Terima kasih atas perhatian anda!



Jika Anda melihat kesalahan atau ketidaktepatan, beri tahu kami dalam pesan pribadi .

Pertanyaan dan saran tulis ke email atau twitter .



Lebih banyak berita dan komentar di saluran PHP Digest Telegram .



Kirim tautan

Cari tautan di semua intisari

← Edisi sebelumnya: PHP-Intisari β„– 182




All Articles