PHP Digest # 187 (18 de agosto - 7 de septiembre de 2020)



Nueva selección con enlaces a noticias y materiales. En lanzamiento: PHP 8 beta 3, nueva sintaxis de atributos adoptada en PHP 8, Zephir todo, un montón de herramientas útiles, artículos, videos, podcasts.



¡Disfruta leyendo!





Noticias y comunicados





PHP Internals



  • cheque [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")
    ]


    .
  • nuevo [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









/












¡Gracias por su atención!



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

Preguntas y sugerencias escríbanos a mail o twitter .



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




All Articles