PHP Digest # 196 (1 al 11 de enero de 2021)



Nueva selección con enlaces a noticias y materiales. En lanzamiento: lanzamiento de PHP 8.0.1, motor MySQL en PHP de Vimeo y otros lanzamientos, Enum actualizado y nuevas propuestas para PHP 8.1, "vulnerabilidad" en Laminas, herramientas, artículos, videos, PHP Live Digest a las 20:00 hora de Moscú.



¡Disfruta leyendo!









Noticias y comunicados





PHP Internals



  • [RFC] Enumerations, Round 2 — Enum PHP . : () , Enum ; ; value()



    . № 194 .
  • [RFC] Bundling ext/simdjson into core — PHP simdjson. ext/json json .



    , . PECL , .
  • [RFC] Array unpacking with string keys — PHP 5.6 :



    variadic_function(...['apple', 'banana', 'lemon']);
          
          





    PHP 7.4 :



    $parts = ['apple', 'pear'];
    $fruits = ['banana', 'orange', ...$parts, 'watermelon'];
    // ['banana', 'orange', 'apple', 'pear', 'watermelon'];
    
          
          





    . PHP 8.0 , .



    PHP 8.1 :



    $array1 = ['a' => 'apple', 'p' => 'pear'];
    $array2 = ['b' => 'banana', 'o' => 'orange'];
    $array = [...$array1, ...$array2];
    //     :
    $array = array_merge($array1, $array2);
    
          
          



  • [PR] Use 'ENT_QUOTES|ENT_SUBSTITUTE' for HTML encoding and decoding functions — - , htmlspecialchars()



    ENT_QUOTES



    ENT_SUBSTITUTE



    :



    • ENT_QUOTES — WordPress

    • ENT_QUOTES — Blade (Laravel)

    • ENT_QUOTES | ENT_SUBSTITUTE — Twig (Symfony or Slim)

    • ENT_QUOTES | ENT_SUBSTITUTE — CodeIgniter

    • ENT_QUOTES | ENT_SUBSTITUTE — CakePHP

    • ENT_QUOTES | ENT_SUBSTITUTE — Yii

    .
  • cheque [RFC] Restrict $GLOBALS usage — . $GLOBALS



    PHP 8.1
    , , isset unset:
    $GLOBALS['x'] = 1;
    
    echo $GLOBALS['x']
    
    isset($GLOBALS['x']);
    unset($GLOBALS['x']);
          
          





    $GLOBALS



    :
    $GLOBALS = [];
    $GLOBALS =& $x;
    $x =& $GLOBALS;
    unset($GLOBALS);
          
          





    , $GLOBALS



    :
    
    asort($GLOBALS);
    // > Compile-time error
          
          





    PHP PHP.


  • [RFC] Concepts to improve mysqli extension — PHP PDO. mysqli. , .
  • [RFC] Add array_is_list(array $array): bool — , true



    , 0, 1, 2 ... count($value)-1



    . is_list()



    array_is_list()



    . .



    Symfony PHP 8.1 .
  • PHP 8.1 : xxHash MurmurHash3.






Symfony





Laravel





Yii





Zend / Laminas



  • 2020 Laminas Project
  • Zend Framework / Laminas — «» :



    class MyClassWithToString {
        public $name;
    
        public function __construct($name) {
            $this->name = $name;
        }
    
        public function __toString() {
            return (string) $this->name;
        }
    }
    
    $input = unserialize('O:19:"MyClassWithToString":1:{s:4:"name";s:15:"/tmp/etc/passwd";}');
    if ($input instanceof MyClassWithToString) {
        unlink($input);
    }
          
          





    is_string()



    unlink()



    . , . php.net , unserializie()



    .



    , 2017 , unserialize()



    ( PHP).



    Yii.


Async PHP







  • PHP FPM Kubernetes .
  • — , PHP. , public/private get set

    clone-with.



    PSR-7.
  • PHP
  • habr legacy — , ! PHP


/




















Hoy habrá el tercer flujo basado en PHP Digest. Análisis de noticias y enlaces del tema con detalles y detalles, un repaso de lo enviado, interesante pero no incluido en el número, los resultados del dibujo y un nuevo concurso con elefantes.

A partir de las 20:00 Moscú, Minsk / 19:00 Kiev.






Si observa un error o inexactitud, háganoslo saber en un habr personal o telegrama .





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




All Articles