PHP Digest # 186 (August 3 - 17, 2020)



Fresh selection with links to news and materials. In: PHP 8 Beta 1, again on attribute syntax in PHP 8: #[Attr]vs @[Attr], syntax suggestion for BigInt, PHP 8 reviews and many more videos, tools, streams, podcasts.



Enjoy reading!





News and releases



  • PHP 8.0.0 Beta 1 - With the first beta release , the active development phase ends , which means that the list of new features and changes in the 8.0 branch can be considered final. (Except for attribute syntax). The next beta is expected on August 20.
  • PHP 7.4.9 , 7.3.21 , 7.2.33 - Security releases of up-to-date branches with a fix for a vulnerability in phar .
  • WordPress 5.5 β€œEckstine” - Finally added auto-update themes and plugins to help make CMS installations safer.


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.
  • cross [RFC] PHP Namespace Policy β€” .




  • PHPUnit 9.3 β€” C PHP 8 Xdebug 3.
  • sebastianbergmann/cli-parser β€” , PHPUnit.
  • coduo/php-matcher β€” , .
  • phpfn/phpfn β€” SerafimArts.
  • 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: .
  • video Laravel.
  • video 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


/



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




  • www.elephpant.com - Original blue and pink elephants can be ordered by email to designer Vincent Pontier .



    The grays and blacks are also available at the Symfony shop.symfony.com - now shipping worldwide.






Thank you for attention!



If you notice an error or inaccuracy, please let us know in a personal .

Questions and suggestions write to mail or twitter .



More news and comments on the PHP Digest Telegram channel .



Send link

Search links in all digests

← Previous issue: PHP-Digest β„– 185




All Articles