PHP Digest # 185 (20 de julio - 3 de agosto de 2020)



Nueva selección con enlaces a noticias y materiales. En el lanzamiento: PHP 8 Alpha 3, PhpStorm 2020.2, un nuevo operador ?->, nuevamente una discusión de la sintaxis de atributos y otras noticias de PHP Internals, una descripción general del sistema de tipos en PHP, una parte de herramientas útiles, videos, transmisiones y mucho más.



¡Disfruta leyendo!





Noticias y comunicados



  • PHP 8.0.0 Alpha 3 : la última versión alfa planificada . La primera beta está prevista para el 6 de agosto.
  • PhpStorm 2020.2 — PHP 8, , - GitHub, OpenAPI. .


PHP Internals



  • [RFC] Shorter Attribute Syntax Change — PHP 8 . .



    : << >>, @@, .

    @@ , RFC . , #[ ] Rust, .



    , PHP 8.1, - 8.0 4 . PHP 8.0, << >>, #[], @@, PHP 8.1 .



    : @[Attribute], PHPDoc /** @@MyAttribute */, — @ @@, @ .







    , @@, - , T_PAAMAYIM_NEKUDOTAYIM , - — PHP 8 Alpha 3 .
  • cheque [RFC] Treat namespaced names as single token — PHP 8 . , , namespace app\function { class Foo {} } .



    , , :
    use /** Try comments */ \FullyQualified \ /* in this ugly way */ SometTotallyDifferentTrait /** also after */;
  • cheque [RFC] Saner string to number comparisons — .



    PHP 8, == , .



    0 == 'foobar' false.





    <=>, ==, !=, >, >=, < <=, switch, in_array(), sort() .
  • cheque [RFC] Nullsafe operator — PHP 8 nullsafe: ?->.

    C null.



    , :
    
    private function getUserCountry(): ?string
    {
        $session = $this->sessionStorage->getSession();
    
        if (null === $session) {
            return null;
        }
    
        $user = $session->getUser();
    
        if (null === $user) {
            return null;
        }
    
        if (null === $user->address) {
            return null;
        }
    
        return $user->address->country;
    }
    
    :
    $country = $this->sessionStorage->getSession()?->getUser()?->address?->country;


    (@).
  • cheque [RFC] Allow trailing comma in closure use lists — use PHP 8 , .
    
    $f = function (
        $longArgument,
        $longerArgument,
        $muchLongerArgument,
    ) use (
        $longVar1,
        $longerVar2,
        $muchLongerVar3, //      
    ) {
       ...
    };
    
  • cheque [RFC] Named Arguments — PHP 8 !

    , .

    htmlspecialchars($string, ENT_COMPAT | ENT_HTML401 , ini_get("default_charset"), false);
    :

    htmlspecialchars($string, double_encode: false);


    stitcher.io/blog/php-8-named-arguments.
  • [RFC] Renamed Parameters — . RFC.



    :
    
    function callBar(Foo $internalName:externalName) {
        $internalName->bar();
    }
    
    $x = new Foo();
    callBar(externalName: $x);
    


    - Swift. , @@NameAlias.
  • cruzar [RFC] Make constructors and destructors return void — .




  • ramsey/conventional-commitsConventional Commits. , .
  • jubianchi/ppc — . phplrt/phplrt.
  • thephpleague/mime-type-detection — - mime- .
  • zakirullin/typed-accessor — .
  • nette/php-generator — PHP- fluent-.


Symfony



  • Symfony #709 (27 — 2 2020)
  • Using Symfony's service iterators for secondary flows
  • Symfony 4.3 5.0 :


Laravel



  • Laravel 6 7 — Laravel 6 7. Laravel 5.5 'cookie'.
  • butschster/LaravelCycleORMcycle/orm Laravel.
  • - Laravel.
  • habr «».
  • habr Laravel- (27 – 2 2020)
  • vídeo Nuno Maduro Freek Murze PHPUnit Pest.
  • vídeo Laracon EU Online 2020




  • PHP — PHP .
  • PHP 8: .
  • — , , .
  • PHP: Preloading — Manual — - , PHP 7.4.
  • PhpStorm, But Better! #2 — .
  • LearnXdebug.com — Xdebug.
  • ( , , ) .
  • ru MySQL Postgres.
  • ru .
  • habr PHP Internals News #38: WeakMaps.
  • habr PHP.
  • habr PHP-.
  • habr , - ?


/



  • audio PHP Internals News #63André Rømcke .
  • audio PHP Internals News #64Benjamin Eberlei .
  • vídeo Xdebug — Laravel Valet PhpStorm, , , .
  • vídeoru — 3 17.00, .
  • vídeoru MoreView #12 | — elisdn.ru deworker.pro. PHP, , .
  • vídeoru MoreView #13 | — «» Happy Job.
  • vídeoru PHP — .
  • audioru Five Minute PHP # 81 con revisión de rectorphp / rector : ahora los episodios cortos de Five Minute también están en Instagram y TikTok .


¡Gracias por su atención!



Si nota algún error o inexactitud, háganoslo saber personalmente .

Preguntas y sugerencias escríbanos a mail , twitter o telegram pronskiy...



Más noticias y comentarios en el canal PHP Digest Telegram .



Enviar enlace

Buscar enlaces en todos los resúmenes

Número anterior: PHP-Digest № 184




All Articles