PHPダイジェスト#187(2020年8月18日〜9月7日)



ニュースや資料へのリンクを含む新鮮なセレクション。リリース:PHP 8ベータ3では、新しい属性構文がPHP 8、Zephirのすべて、便利なツール、記事、ビデオ、ポッドキャストのすべてに採用されています。



読書を楽しむ!





ニュースとリリース





PHP Internals



  • 小切手 [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")
    ]


    .
  • 新着 [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









/












清聴ありがとうございました!



エラーや不正確さに気付いた場合は、個人でお知らせください

質問や提案はメールツイッターに書いてください



PHPダイジェストテレグラムチャネルに関するその他のニュースとコメント



リンクを送信

すべてのダイジェストでリンクを検索

前号:PHP-ダイジェスト#186




All Articles