PHP Digest # 206 (June 15 - 29, 2021)

Photo: Ivan Gantsev .



A selection of fresh news and materials from the PHP world. In release: the second alpha of PHP 8.1.0 and an overview of what else may be in the release; a new RFC proposing to add an injection protection mechanism. Plus a portion of useful tools, articles, videos and podcasts.



Enjoy reading!



news



  • PHP 8.1.0 alpha 2



    .



    20 . , RFC 22 8.1.



    , :

    • Enum RFC;
    • never



      RFC;
    • RFC;
    • RFC;
    • RFC;
    • float



      int



      , RFC;
    • Serializable



      RFC;
    • 0o



      RFC;
    • $GLOBALS RFC;
    • RFC;




    php.watch/versions/8.1.



    ( ):





PHP Internals



  • check [RFC] Pure intersection types



    PHP 8.1 . TypeA&TypeB



    , instanceof TypeA



    instanceof TypeB



    .



    , :

    , ? , , ( ).



    : PHP.



  • [RFC] Is_Noble



    SQL- PHP . RFC .



    is_noble(string $str): bool



    , ยซยป, , .



    is_noble('Example'); // true
    
    $a = 'Hello';
    $b = 'World';
    
    is_noble($a); // true
    is_noble($a . $b); // true,      
    is_noble("Hi $b"); // true
    
    is_noble($_GET['id']); // false     
    is_noble(sprintf('Hi %s', $_GET['name'])); // false
    is_noble('/bin/rm -rf ' . $_GET['path']); // false
    is_noble('<img src=' . htmlentities($_GET['src']) . ' />'); // false โ€”      
    is_noble('WHERE id = ' . $db->real_escape_string($_GET['id'])); // false
    
          
          



    3v4l.org/1aFC2#focus=rfc.literals



    100%, .



  • [RFC] Deprecate boolean to string coercion



    bool



    string



    , :
    (string)true  -> '1'
    (string)false -> ''
    
          
          







  • Ilija Tovilo RFC 8.1, ยซยป :-)













Symfony







Laravel













/







miscellanea



  • An interesting idea is to override built-in functions and disable the standard implementation via disable_functions :

  • Will Bitrix become the norm?








Subscribe to the PHP Digest Telegram channel .



If you liked the digest, please give it a plus - this is very motivating to keep doing it.



Did you spot a mistake or typo? Inform in a personal habr or telegram .



You can send the link through the form or simply by writing to me in a telegram .

Search for links in all digests

โ† Previous issue: PHP-Digest # 205








All Articles