PHP Digest # 200 (22. Februar - 15. MĂ€rz 2021)

Foto: Grégoire Gaonach



Neue Auswahl mit Links zu Nachrichten und Materialien. In Release: Objekte in Initialisierern, Erweiterungsnamespaces und anderen RFC-VorschlĂ€gen fĂŒr PHP 8.1. PSR-11 aktualisiert, PSR ClockInterface vorgeschlagen. Ein Teil nĂŒtzlicher Tools, Videos, Podcasts, Artikel und PHP Digest Live um 20:00 Uhr GMT.



Viel Spaß beim Lesen!









Nachrichten und Veröffentlichungen



  • PHP 8.0.3 , PHP 7.4.16 .
  • PSR ClockInterface

    , , .



    :



    namespace Psr\Clock;
    
    interface ClockInterface
    {
        /**
         * Returns the current time as a DateTimeImmutable Object
         */
        public function now(): \DateTimeImmutable;
    }
    
          
          



  • PSR-11 Container Interface — , 1.1, , 2.0 — .
  • Git clone — . Git 2.30.2.
  • PhpStorm 2021.1 EAP — : PHP- , JSONPath Video . , EAP .
  • Composer 1.x — 2021 API packagist.org .


PHP Internals



  • [RFC] New in initializers

    PHP , , , . , , — . .



    , , .



    static $x = new Foo();
    
    const C = new Foo();
    
    #[AnAttribute(new Foo())]
    class Test {
        public const C = new Foo();
        public static $prop = new Foo();
        public $prop = new Foo();
    
        public function __construct(
            private Logger $logger = new NullLogger()
        ) {}
    }
    
    function test($param = new Foo()) {}
    
          
          





    new



    , .



    . , , , , , . PHP Live.

  • [RFC] Namespaces in bundled PHP extensions

    , PHP, . .



    RFC , PHP. . OpenSSLCertificate



    OpenSSL\Certificate



    .



    , , RFC . :

    str_contains()



    -> String\contains()





    in_array()



    -> Array\contains()



    .

    PHP 9.
  • [RFC] Static variables in inherited methods

    , , . , .



    RFC , .

    class A {
        public static function counter() {
            static $i = 0;
            return ++$i;
        }
    }
    class B extends A {}
    
    var_dump(A::counter()); // int(1)
    var_dump(A::counter()); // int(2)
    var_dump(B::counter()); // int(3)
    var_dump(B::counter()); // int(4)
    
          
          





  • [RFC] Fibers

    . , . : , , PHP . , :



    Swoole. , Swoole PHP, — , .



    Joe Watkins, , /. krakjoe/parallel .



    , , — , Swoole parallel.
  • [RFC] noreturn type

    Psalm PHPStan PHP — noreturn



    .



    , , exit()



    , die()



    , trigger_error()



    .



    function redirect(string $uri): noreturn {
        header('Location: ' . $uri);
        exit();
    }
    
    function redirectToLoginPage(): noreturn {
        redirect('/login');
    }
    
          
          





    Hack, Python, Psalm, PHPStan PhpStorm #[NoReturn]



    exitpoint .phpstormmeta.php.
  • [RFC] debug_backtrace_depth(int $limit=0): int — debug_backtrace_depth(int $limit=0), . , .



    : count(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, $limit=0))



    .
  • [RFC] println(string $data = ''): int — println



    , stdout



    . str_contains()



    , , .






Symfony





Laravel





Yii













Audio-
















Nach einer kurzen Pause kehren wir mit einem Stream und Moderator Valentin Udaltsov zurĂŒck!



Es wird eine Analyse von Nachrichten und Links aus der Ausgabe mit Details und Details, Valentins Meinung zu RFCs und Artikeln geben. Interessant, aber nicht in der Ausgabe enthalten, die Ergebnisse der Zeichnung und ein neuer Wettbewerb mit Elefanten.



Ab 20:00 Uhr Moskau, Minsk / 19:00 Uhr Kiew.




Wenn Sie einen Fehler oder eine Ungenauigkeit bemerken, teilen Sie uns dies bitte in einem persönlichen Habr oder Telegramm mit .





Weitere Neuigkeiten und Kommentare zum PHP Digest Telegram-Kanal .



Link senden

Links in allen Digests suchen

← Vorherige Ausgabe: PHP-Digest # 199




All Articles