PHP Digest # 202 (1er au 30 avril 2021)



Le nouveau type never



sera en PHP 8.1, discutant des fonctions partielles, et d'autres suggestions et nouvelles de PHP Internals. PHP est disponible sur Google Cloud Functions, sur le piratage de git.php.net, Laravel Octane, PhpStorm 2021.1 et d'autres versions, une partie d'outils, des vidéos, des podcasts, des articles.



Bonne lecture!









nouvelles



  • git.php.net

    PHP . . .



    , git.php.net HTTPS -, md5 . master.php.net — , , .



    GitHub, .
  • PHP 7.3.28, PHP 8.0.5 — .



  • PHP Google Cloud Functions

    Serverless Google Cloud PHP. GoogleCloudPlatform/functions-framework-php/ PHP 7.4.



    GitHub Symfony. Symfony 5.3 Runtime, php-runtime/google-cloud.



  • Composer Command Injection Vulnerability

    Mercurial. 2.0.13 1.10.22, . .



  • :



    phpcommunity.ru.



PHP Internals



  • Chèque [RFC] never type

    PHP 8.1 : never



    .



    , never



    , , die()



    , exit()



    . .



    function redirect(string $uri): never {
        header('Location: ' . $uri);
        exit();
    }
    
    function redirectToLoginPage(): never {
        redirect('/login');
    }
          
          





    , php.watch, l'audio PHP Internals News .



  • Chèque [RFC] Deprecate implicit non-integer-compatible float to int conversions

    PHP 8.1 float



    int



    , , E_DEPRECATED



    . PHP 9.0 TypeError



    .



    function acceptInt(int $i) {
            var_dump($i);
    }
    acceptInt(3.1415);
    
    > int(3) // Deprecation notice  
          
          





    l'audio PHP Internals News.



  • Chèque [RFC] Phasing out Serializable

    PHP 8.1 Serializable



    . Deprecation notice , , , __serialize()



    __unserialize()



    .



  • - PHP 8.1

    : core- Joe Watkins ( pthreads, parallel pcov), Patrick Allaert (blackfire.io) Ben Ramsey ( ramsey/uuid).



    , s_panteleev, BeerPHP . , - PHP 8.2!








    PHP 8.1:
  • [RFC] Partial Function Application

    ( ) — ( ) , .



    , :

    function whole($one, $two) {
        /* ... */
    }
          
          





    :

    $partial = whole(?, 2);
          
          





    , :

    function($one) {
        /* ... */
    }
          
          





    ?



    -, , Callable



    . , :

    array_map(Something::toString(?), [1, 2, 3]);
    array_map(strval(?), [1, 2, 3]);
    
    // 
    array_map([Something::class, 'toString'], [1, 2, 3])
    array_map('strval', [1, 2, 3]);
          
          





    -, , pipe- |>



    :

    $result = "Hello World"
        |> htmlentities(?)
        |> explode(?);
          
          





    3v4l.org.



    Larry Garfield, Joe Watkins, Levi Morrison Paul Crovella RFC .



  • [RFC] Sealed Classes

    RFC sealed , .



    sealed- .



    :

    sealed class Shape permits Circle, Square, Rectangle {}
    
    final class Circle extends Shape {} // ok
    final class Square extends Shape {} // ok
    final class Rectangle extends Shape {} // ok
    
    final class Triangle extends Shape {} // Fatal error: Class Triangle cannot extend sealed class Shape.
          
          





    Java.



  • [RFC] Autoload Classmap — , ( => ) . , RFC.
  • [PR] Add support for final constantsfinal



    , .






Symfony





Laravel





Async PHP





phpstorm PhpStorm













/






En raison de problèmes de santé, les flux sont toujours suspendus.




Si vous remarquez une erreur ou une inexactitude, veuillez nous en informer dans un habr personnel ou un télégramme .

Abonnez-vous à la chaîne PHP Digest Telegram .



Envoyer le lien

Rechercher des liens dans tous les résumés

Numéro précédent: PHP-Digest # 201








All Articles