ملخص PHP # 183 (22 يونيو - 5 يوليو 2020)

تصوير جيمس تيت كومب



مجموعة مختارة مع روابط للأخبار والمواد. كل شيء عن PHP 8 في الإصدار: ألفا الأولى ، تعبير جديد match، خطأ في بناء الجملة @@للسمات ، معايير JIT الحقيقية ، 4 مقترحات جديدة. وكما هو الحال دائمًا ، الأدوات والمقالات ومقاطع الفيديو وملفات البودكاست.



استمتع بالقراءة!



الأخبار والنشرات



  • PHP 8.0 alpha 1 — - PHP! .

    :



    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



  • التحقق من [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.
  • التحقق من [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 listsuse , .



    $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 Changesdeclare __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 , .






Symfony





Laravel





Async PHP









/





شكرا على انتباهك!



إذا لاحظت خطأ أو عدم دقة ، يرجى إعلامنا في رسالة شخصية .

إرسال الأسئلة والاقتراحات إلى البريد أو تويتر .



المزيد من الأخبار والتعليقات على قناة PHP Digest Telegram .



إرسال رابط

روابط البحث في جميع الملخصات

العدد السابق: PHP-Digest № 182




All Articles