PHP Digest No. 181 (May 18 - June 1, 2020)

Erika Heidi Photos

Fresh selection with links to news and materials. In the issue: 3 new and 4 accepted RFC proposals for PHP 8, including declaring properties in the constructor, about blocking PHP-ML due to plagiarism, why developers hate PHP, a portion of useful tools, videos and much more.

Enjoy reading!



News and Releases



PHP Internals


  • check [RFC] Constructor Property Promotion โ€” PHP 8

    // 
    class Point {
        public float $x;
        public float $y;
        public float $z;
    
        public function __construct(
            float $x = 0.0,
            float $y = 0.0,
            float $z = 0.0,
        ) {
            $this->x = $x;
            $this->y = $y;
            $this->z = $z;
        }
    }
    
    // 
    class Point {
        public function __construct(
            public float $x = 0.0,
            public float $y = 0.0,
            public float $z = 0.0,
        ) {}
    }
    

    Hack, TypeScript, Kotlin, Scala. , PHP. :

    class Foo {
        public function __construct(
            <<ExampleAttribute>>
            public int $prop,
        ) {}
    }
    
  • check [RFC] Mixed Type v2 โ€” RFC, mixed PHP 8. PHP Digest c mixed.
  • check [RFC] Always available JSON extension โ€” PHP 8 JSON .
  • check [RFC] non-capturing catches โ€” PHP 8 catch:

    try {
        changeImportantData();
    } catch (PermissionException) {
        echo "You don't have permission to do this";
    }
    
  • [RFC] Error backtraces โ€” , PHP . . Error , , , Error.
  • [RFC] Match expression v2 โ€” match, switch, .

    echo match (1) {
        0 => 'Foo',
        1 => 'Bar',
        2 => 'Baz',
    };
    //> Bar
    

    .
  • [RFC] Attribute Amendments โ€” : <<Attr1, Attr2>>, PhpAttribute Attribute. , , //. , . , , RepeatableAttribute.



Symfony



Laravel



Async PHP





/



Thank you for the attention!

If you notice a mistake or inaccuracy - please inform me in PM .
Questions and suggestions write to mail or twitter .

More news and comments on the PHP Digest Telegram Channel .

Send link
Search links for all digests
โ† Previous release: PHP Digest No. 180


All Articles