PHP Digest # 199 (8 al 22 de febrero de 2021)



PHP 8.1 tendrá una enumeración y dos más aceptadas, dos rechazadas y tres nuevas RFC para PHP 8.1. WordPress es utilizado por el 40% de los sitios. Por qué necesita eliminar estrictos_tipos, por qué no debe usar empty (), así como herramientas, videos, artículos, podcasts y PHP Digest Live a las 10:00 GMT.



¡Disfruta leyendo!









Noticias y comunicados





PHP Internals



  • controlar [RFC] Enumerations

    44 7 . PHP 8.1 enum.



    enum RfcStatus {
        case Draft;
        case UnderDiscussion;
        case Accepted;
    }
    
    function setRfcStatus(RfcStatus $status) :void {
        // ...
    }
    
    setRFCStatus(RfcStatus::Accepted); // 
    setRFCStatus('Draft');                     // Deprecation notice  8.1, TypeError  9.0
    
          
          





    RFC php.watch.



    Symfony .
  • controlar [RFC] Deprecate passing null to non-nullable arguments of internal functions

    PHP null



    , nullable



    .



    PHP 8.1 TypeError



    . , str_contains("", null)



    . 3v4l.org/OVoa0A.



    : , PHP.
  • controlar [RFC] Array unpacking with string keys

    PHP 8.1 , :



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



  • [RFC] Fibers

    , .



    Fiber API Ruby.



    ReactPHP trowski/react-fiber:



    
    $loop = new FiberLoop(Factory::create());
    
    $browser = new Browser($loop);
    
    $request = function (string $method, string $url) use ($browser, $loop): void {
        /** @var Response $response */
        $response = $loop->await($browser->requestStreaming($method, $url));
    
        /** @var ReadableStreamInterface $stream */
        $stream = $response->getBody();
    
        $body = $loop->await(Stream\buffer($stream));
    
        var_dump(\sprintf(
            '%s %s; Status: %d; Body length: %d',
            $method,
            $url,
            $response->getStatusCode(),
            \strlen($body)
        ));
    };
    
    $requests = [];
    
    $requests[] = $loop->async($request, 'GET', 'https://reactphp.org');
    $requests[] = $loop->async($request, 'GET', 'https://google.com');
    $requests[] = $loop->async($request, 'GET', 'https://www.php.net');
    
    $loop->await(Promise\all($requests));
    
          
          



  • [RFC] CachedIterable (rewindable, allows any key&repeating keys)

    Tyson Andre . .
  • Proposal: namespace the SPL

    Spl



    : Spl\FixedArray



    -> SplFixedArray



    . , CachedIterable



    ReverseIterator



    .



    azjezz/psl.

  • [RFC] mysqli bind in execute

    Kamil Tekiela mysqli



    . RFC mysqli_stmt::execute()



    . , , mysqli_stmt::bind_param()



    . , bind_param .
  • cruzar [RFC] PHP\iterable\any() and all() on iterablesany()



    all()



    .
  • cruzar [RFC] var_representation(): readable alternative to var_export()var_export



    , brick/varexporter.
  • [Draft] Unify PHP's typing modes — PHP . — , , – strict_types=1



    – . , , .



    George Peter Banyard, RFC.



    .
  • Observer API PHP 8 — API . Xdebug, APM- New Relic, Tideways, ..






Symfony





Laravel





Yii





Async PHP



  • swow/swow — PHP, libuv, , PDO, file_get_ontents() .. ( ). , Swoole.


phpstorm PhpStorm









/





Entretenido



  • mario-deluna / php-render es un renderizador PHP 3D puro, incluso sin usar FFI. Shaders, analizador de archivos .obj y más.



    Código de ejemplo:
















Ya es un flujo tradicional basado en PHP Digest. Habrá un análisis de noticias y enlaces del problema con detalles y detalles adicionales.

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






Si nota un error o inexactitud, háganoslo saber en un Habr o telegrama personal .





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 № 198




All Articles