Re: [PHP-DEV] [RFC] Short-function syntax

2020-10-20 Thread Mike Schinkel
> On Oct 20, 2020, at 2:19 PM, Larry Garfield wrote: > > A while back, Nikita mentioned that it should now be easy to offer an > abbreviated syntax for functions that are just a single expression. I > decided to take a crack at it and it turns out he was right. I thus offer > this RFC: > >

Re: [PHP-DEV] Is there any interest for object constructor shorthand *just for stdClass*

2020-10-20 Thread Larry Garfield
On Tue, Oct 20, 2020, at 5:53 PM, tyson andre wrote: > Hi internals, > > e.g. `$x = object{key: object{'escaped-literal': $v2 }};` > (equivalent to `$x = (object)['key' => (object)['escaped-literal' => $v2]];`) > > For example, in JS, non-string key literals are surrounded in `[]` to >

[PHP-DEV] Idea: Warning about named parameters with a missing constructor?

2020-10-20 Thread tyson andre
Hi internals, Currently, if there is no constructor, php handles it just like `__construct(...$args) {}`, both for positional and named parameters. Is there any interest in changing that to be a deprecation warning if one or more parameters are passed? (or if 1 or more named parameters are

[PHP-DEV] Is there any interest for object constructor shorthand *just for stdClass*

2020-10-20 Thread tyson andre
Hi internals, e.g. `$x = object{key: object{'escaped-literal': $v2 }};` (equivalent to `$x = (object)['key' => (object)['escaped-literal' => $v2]];`) For example, in JS, non-string key literals are surrounded in `[]` to unambiguously reference them. Here, that could be `object{[$key]: $value,

[PHP-DEV] [RFC] Short-function syntax

2020-10-20 Thread Larry Garfield
A while back, Nikita mentioned that it should now be easy to offer an abbreviated syntax for functions that are just a single expression. I decided to take a crack at it and it turns out he was right. I thus offer this RFC: https://wiki.php.net/rfc/short-functions Hopefully I made a decent

Re: [PHP-DEV] List of attributes

2020-10-20 Thread Rowan Tommins
On Mon, 19 Oct 2020 at 16:17, Theodore Brown wrote: > > In theory nested attributes could be supported in the same way with > the `#[]` syntax, but it's more verbose and I think less intuitive > (e.g. people may try to use the grouped syntax in this context, but > it wouldn't work). Also the

Re: [PHP-DEV] PHP 8 release announcement page on php.net

2020-10-20 Thread Gabriel Caruso
On Mon, 19 Oct 2020 at 15:54, Roman Pronskiy wrote: > On Fri, Oct 16, 2020 at 1:51 AM Gabriel Caruso > wrote: > > > > Roman, > > > > One question that I've received from a couple of communities about this > proposal: can we have translations of this page? Portuguese, French, > Russian, etc. > >