PHP Digest # 186 (3 - 17 août 2020)



Nouvelle sélection avec des liens vers des nouvelles et des documents. Dans: PHP 8 Beta 1, encore une fois sur la syntaxe des attributs dans PHP 8: #[Attr]vs @[Attr], suggestion de syntaxe pour BigInt, critiques de PHP 8 et bien d'autres vidéos, outils, flux, podcasts.



Bonne lecture!





Nouvelles et communiqués



  • PHP 8.0.0 Beta 1 — - , 8.0 . ( ). 20 .
  • PHP 7.4.9, 7.3.21, 7.2.33 phar.
  • WordPress 5.5 “Eckstine” — - , CMS .


PHP Internals



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



    Tycon Andre , #[Attr] PHP 7. C , , ?



    @@Attr, #[Attr], <<Attr>> @[Attr]:
    @@ORM\Entity
    @@ORM\Table("user")
    class User
    {
        @@ORM\Id @@ORM\Column("integer") @@ORM\GeneratedValue
        private $id;
    
        @@ORM\Column("string", ORM\Column::UNIQUE)
        @@Assert\Email(["message" => "The email '{{ value }}' is not a valid email."])
        private $email;
    }
    
    #[
      ORM\Entity,
      ORM\Table("user")
    ]
    class User
    {
        #[ORM\Id, ORM\Column("integer"), ORM\GeneratedValue]
        private $id;
    
        #[ORM\Column("string", ORM\Column::UNIQUE)]
        #[Assert\Email(["message" => "The email '{{ value }}' is not a valid email."])]
        private $email;
    }
    
    @[
      ORM\Entity,
      ORM\Table("user")
    ]
    class User
    {
        @[ORM\Id, ORM\Column("integer"), ORM\GeneratedValue]
        private $id;
    
        @[ORM\Column("string", ORM\Column::UNIQUE)]
        @[Assert\Email(["message" => "The email '{{ value }}' is not a valid email."])]
        private $email;
    }
    
    <<
      ORM\Entity,
      ORM\Table("user")
    >>
    class User
    {
        <<ORM\Id, ORM\Column("integer"), ORM\GeneratedValue>>
        private $id;
    
        <<ORM\Column("string", ORM\Column::UNIQUE)>>
        <<Assert\Email(["message" => "The email '{{ value }}' is not a valid email."])>>
        private $email;
    }
    
    @:ORM\Entity
    @:ORM\Table("user")
    class User
    {
        @:ORM\Id @:ORM\Column("integer") @:ORM\GeneratedValue
        private $id;
    
        @:ORM\Column("string", ORM\Column::UNIQUE)
        @:Assert\Email(["message" => "The email '{{ value }}' is not a valid email."])
        private $email;
    }
    
  • [RFC] Named Parameters explicit opt in — , .
    //    
    function callBar(Foo $:parameterName) {
        $internalName->bar();
    }
    
    $x = new Foo();
    callBar(parameterName: $x);
    
    //   
    function callBar($externalName) {
        $externalName->bar();
    }
    
    $x = new Foo();
    callBar(externalName: $x); // Error: cannot call function callBar() using parameter $externalName by name.
    
    PHP 8 , 8.1, .
  • [Proposal] Bigint shorthand (123n) for GMP objects RFC.



    PHP JavaScript «n»:
    $theBiggestInt = 9007199254740991n


    GMP. GMP , , .
  • PHP (php -a), PR, . bobthecow/psysh.
  • traverser [RFC] PHP Namespace Policy — .




  • PHPUnit 9.3 — C PHP 8 Xdebug 3.
  • sebastianbergmann/cli-parser — , PHPUnit.
  • coduo/php-matcher — , .
  • phpfn/phpfnSerafimArts.
  • hidehalo/nanoid-php — PHP- Nanoid — URL- .
  • woohoolabs/zen — PSR-11- .
  • loophp/collection — .


Symfony



  • mrsuh/json-validation-bundle — JSON / json-schema.org.
  • Symfony- AWS Lambda
  • habr SSR: ReactJS PHP.


Laravel



  • Laravel: .
  • vidéo Laravel.
  • vidéo Better Laravel Way — .
  • habr Laravel- (10–16 2020)




  • PHP Codeception.
  • PHP-.
  • PHP.
  • Method fossilisation — .
  • PHP- .
  • KPHPStorm — 7 KPHP. C .



    , KPHP , PhpStorm, .



    github.com/unserialize/kphpstorm.
  • PHP — - RFC , .
  • habr Highload PHP: .
  • habr PHP 8: «» «» ( PHP 7.4)
  • habr html- php , .
  • habr php 8 JIT Docker 5


/



  • vidéo PHP 8: Process & fixing insanity — PHP 8 core- George Peter Banyard. , William Pinaud.
  • vidéo Type Juggling Magic: Why PHP thinks 0 and «password» are the same — , PHP .
  • vidéo Dutch PHP Conf 2020
  • vidéoru « PHP GO» PHP Go .
  • l'audioru PHP #82: declare(strict_types=1).
  • l'audioru PHP #83: ?
  • l'audio Voices of the ElePHPant: — - PHP 8 Sara Golemon Garbriel Caruso — .
  • l'audio PHP Internals News #66 PHP 8 PHP .
  • l'audio PHP Internals News #65Dan Ackroyd ?-> PHP 8.




  • www.elephpant.com - Les éléphants bleus et roses originaux peuvent être commandés par email au designer Vincent Pontier .



    Les gris et les noirs sont également disponibles sur Symfony shop.symfony.com - maintenant expédiés dans le monde entier.






Merci de votre attention!



Si vous constatez une erreur ou une inexactitude, veuillez nous en informer à titre personnel .

Questions et suggestions écrites sur mail ou twitter .



Plus de nouvelles et de commentaires sur la chaîne PHP Digest Telegram .



Envoyer le lien

Rechercher des liens pour tous les résumés

Numéro précédent: PHP-Digest № 185




All Articles