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

2020-10-21 Thread Mike Schinkel
> On Oct 21, 2020, at 8:50 AM, Larry Garfield wrote: > > On Tue, Oct 20, 2020, at 11:08 PM, Mike Schinkel wrote: >>> 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 ju

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

2020-10-21 Thread Larry Garfield
On Wed, Oct 21, 2020, at 5:17 PM, Rowan Tommins wrote: > It occurred to me recently that maybe we could make "function" and "fn" > synonyms everywhere, i.e. make both "$double = function($x) => $x *2;" > and "$double = fn($x) use ($x) { return $x *2; };" valid. I'm not sure > if that's desirabl

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

2020-10-21 Thread Rowan Tommins
On 21/10/2020 21:53, 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: https://wiki.php.net/rfc/sh

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

2020-10-21 Thread tyson andre
Hi 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/

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

2020-10-21 Thread Larry Garfield
On Tue, Oct 20, 2020, at 1: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: > > h

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

2020-10-21 Thread Rowan Tommins
On 21/10/2020 10:47, Pierre wrote: I'd recommend that if your data is arbitrary, you can use arrays, if you it's not, you probably always should write typed value objects This is pretty much what I was going to say. If you have truly dynamic keys, then having the full set of array functions a

Re: [PHP-DEV][RFC] Add support for explicit octal notation for integer literals

2020-10-21 Thread Sara Golemon
On Wed, Oct 21, 2020 at 9:59 AM G. P. B. wrote: > A rather short RFC about adding support for the "0o" prefix for octal > integers. > https://wiki.php.net/rfc/explicit_octal_notation > > Surprisingly PHP already accepts the prefix within octdec() and > base_convert(). > > I have hopefully covered

[PHP-DEV] hash BLAKE3

2020-10-21 Thread Hans Henrik Bergan
i want BLAKE3 hash support in php, some justifications can be found here https://bugs.php.net/bug.php?id=79492 primary reasons being that it's a "cryptographically secure hash", predecessor BLAKE was nearly crowned "SHA3" (SHA3 finalist), and it's very fast in software, when i run it against php-s

[PHP-DEV] [RFC] HashContext OOP api discussion period opened

2020-10-21 Thread Sara Golemon
https://wiki.php.net/rfc/hash.context.oop

Re: [PHP-DEV] Re: want an Object-oriented interface for HashContext

2020-10-21 Thread Hans Henrik Bergan
@Rowan Tommins >I think I'd prefer to drop the fluent interface (returning void on most > things, and relevant values on others) well both approaches has pros and cons, that said, the sample implementation Sara posted returns $this, if you (or anyone) feels strongly about it one way or the othe

[PHP-DEV][RFC] Add support for explicit octal notation for integer literals

2020-10-21 Thread G. P. B.
Hello internals, A rather short RFC about adding support for the "0o" prefix for octal integers. https://wiki.php.net/rfc/explicit_octal_notation Surprisingly PHP already accepts the prefix within octdec() and base_convert(). I have hopefully covered all the cases where this may apply but if you

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

2020-10-21 Thread Larry Garfield
On Tue, Oct 20, 2020, at 11:08 PM, Mike Schinkel wrote: > > 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

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

2020-10-21 Thread Nikita Popov
On Wed, Oct 21, 2020 at 1:01 AM tyson andre wrote: > 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 para

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

2020-10-21 Thread Pierre
Le 21/10/2020 à 11:38, Björn Larsson a écrit : > > Well, but for us with a legacy code base where this is heavily used > it would definitely be an improvement! It would enable a so called > stepwise refinement :-) > > One typical usecase we have is populating an object with the result > from a DB q

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

2020-10-21 Thread Björn Larsson
Den 2020-10-21 kl. 01:30, skrev 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