PHP Digest # 187 (August 18 - September 7, 2020)



Fresh selection with links to news and materials. In release: PHP 8 beta 3, new attribute syntax adopted in PHP 8, Zephir everything, a whole bunch of useful tools, articles, videos, podcasts.



Enjoy reading!





News and releases



  • PHP 8 beta 3 - The last beta in the cycle. The next release will be RC 1, which is expected on September 17th.
  • PHP 7.4.10 , PHP 7.3.22
  • Zephir Phalcon β€” Zephir PHP- Phalcon , Zephir , Phalcon 5 PHP.
  • WordPress PHP. Matt Mullenweg, PHP 5.6 . PHP ≀5.6 21.6% WP.


PHP Internals



  • check [RFC] Shorter Attribute Syntax Change β€” - . #[Attribute].
    #[
      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;
    }
    


    , @@Attr PR. #[ ] , .



    //   
    #[ORM\Entity]
    #[ORM\Table("user")]
    
    //  
    #[
        ORM\Entity,
        ORM\Table("user")
    ]


    .
  • new [RFC] any() and all() on iterables β€” :

    any(iterable $input, ?callable $callback = null): bool β€” , , true.

    all(...) β€” true , true .



    :



    // 
    $satisifes_predicate = false;
    foreach ($item_list as $item) {
        if (API::satisfiesCondition($item)) {
            $satisfies_predicate = true;
            break;
        }
    }
    if (!$satisfies_predicate) {
        throw new APIException("No matches found");
    }
    
    // 
    if (!any($item_list, fn($item) => API::satisfiesCondition($item))) {
        throw new APIException("No matches found");
    }






Symfony





Laravel





Yii





Async PHP









/












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 # 186




All Articles