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, . .



  • :

    • 15 (), + , PHP- — , , kPHP, devops Go. .
    • 28 (), , , PHP Russia, 2021 — 30 .


    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



    , .




  • spatie/data-transfer-object v3 — DTO PHP 8.
  • spatie/fork — pcntl_fork PHP .
  • squizlabs/PHP_CodeSniffer 3.6.0 — PHP 8.


Symfony



  • symfony/ux-turbo — Ruby on Rails JS- hotwired/turbo. , SPA, JS-.



    , AJAX- , URL pushState. , .



    UX Turbo — Symfony. - Symfony Mercure - .



    .
  • dykyi-roman/crossword — , Symfony. Roman Dykyi.
  • End-to-end Symfony Panther.
  • Symfony #747 (19-25 2021)


Laravel



  • laravel/octane — Laravel Swoole RoadRunner, . , ru Mohamed Said (Laravel core), ru .
  • thedevdojo/wave — SS Laravel: , , API, , .
  • Christoph Rumpel Livewire.
  • Event Sourcing in Laravel — Spatie. . .
  • vidéo Laravel laravel-signal-aware-command.
  • vidéo Laravel Worldwide Meetup #8


Async PHP



  • reactphp/http v1.3.0 — HTTP ReactPHP keep-alive x2 .
  • WordPress-PSR/swoole — WordPress Swoole.
  • habr PHP: - .


phpstorm PhpStorm



  • habr PhpStorm 2021.1 — .
  • Live Template' PhpStorm Doctrine
  • Symfony PhpStorm Ideolog.








  • PHP 8.0.
  • Named-entity recognition PHP — ML- RubixML.
  • PHP.
  • PHP .
  • habr Escape- PHP.
  • habr , … — , .
  • habr .


/



  • l'audioru « » №14 — open source.
  • vidéoru PHP-
  • vidéoru « - PHP»
  • vidéo Modern PHP with Rasmus Lerdorf — PHP Etsy PHP 8.
  • vidéo Xdebug 3 Docker PhpStorm 5 — Xdebug.
  • l'audio PHP Internals News podcast #82 — (RFC) Larry Garfield Nuno Maduro.
  • l'audio Podcast PHP Internals News # 79 - Pro new



    dans les initialiseurs
    avec Nikita Popov .
  • vidéo PHP Release Radar # 8 - De Nuno Maduro à Pest .
  • vidéo PHP Release Radar # 9 - Avec Andreas Braun sur Doctrine Cache 2.0.



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