Re: [PHP-DEV] Alias stdClass to DynamicObject?

2021-09-06 Thread Hossein Baghayi
On Tue, 7 Sept 2021 at 01:12, Aran Reeks wrote: > ... Too much code depends on an expected type of stdClass > presently which would likely make future upgrades more difficult for no > functional gain, beyond some added clarify. What if we had the DynamicObject as a subclass of stdClass? It

Re: [PHP-DEV] Guidelines for RFC post feature-freeze

2021-08-26 Thread Hossein Baghayi
Hello, One question I have (as I always do) regarding nullable intersection types, (which is a forbidden topic and I know I shouldn't bring it up). I'd love to know how `Consistency` plays a role in new RFCs. Are we striving for consistency? Is it a value here? Or simply it is a side effect? We

Re: [PHP-DEV] Unwrap reference after foreach

2021-08-14 Thread Hossein Baghayi
On Fri, 13 Aug 2021 at 17:59, Nikita Popov wrote: > I'd like to address a common footgun when using foreach by reference: > https://wiki.php.net/rfc/foreach_unwrap_ref > Hello, I had a question regarding this. Wouldn't it be possible to limit ```$value```'s scope to only foreach's block then

Re: [PHP-DEV] [Proposal] call_user_func_map(): flexible named parameter mapping for call_user_func*

2021-07-01 Thread Hossein Baghayi
Hello, On Sun, 27 Jun 2021 at 19:09, Ralph Schindler wrote: > > This proposes a method for a publisher/framework/producer (the caller of > the callback) to document all the parameters that are available as named > parameters, and subscribers/consumers (creator of the callback) could > subscribe

Re: [PHP-DEV] [RFC] Name issue - is_literal/is_trusted

2021-06-23 Thread Hossein Baghayi
Hello, What about `is_vulnerable`? Its behaviour would be the inverse of is_literal. I mean we don't have to avoid the other side of the coin. On Tue, 22 Jun 2021 at 22:41, Craig Francis wrote: > Hi Internals, > > As the name `is_trusted()` seems to be causing contention, I think more > than

Re: [PHP-DEV] Consensus Gathering: is_initialized

2021-05-27 Thread Hossein Baghayi
Out of curiosity, Couldn't PHP raise an error when there is an uninitialized state left unhandled after calling the constructor? It might make the developer think of either providing a default value or initializing it in the constructor. Hence no uninitialized state.

Re: [PHP-DEV] A little syntactic sugar on array_* function calls?

2021-05-26 Thread Hossein Baghayi
On Wed, 26 May 2021 at 10:14, Hamza Ahmad wrote: > Thus, array() or [] will return scaler array object, > Hello, This doesn't seem trivial to me. I mean, should array object be passed by value or by reference? Arrays are passed by value by default so far, and objects are be-ref internally. If

Re: [PHP-DEV] [RFC] Partial function application

2021-05-16 Thread Hossein Baghayi
On Sat, 15 May 2021 at 09:03, Hossein Baghayi wrote: > Providing ? as a means of placeholder for some arguments and ignoring the > rest could complicate the readability in my opinion. > Maybe we should move (?) out of the arguments list as a means of creating > a partial. > &g

Re: [PHP-DEV] [RFC] Partial function application

2021-05-14 Thread Hossein Baghayi
> Requiring additional trailing argument placeholders or adding an > additional token `...?` unnecessarily complicates things, burdens the > user, and only serves to further promote misunderstanding. > > Providing ? as a means of placeholder for some arguments and ignoring the rest could

Re: [PHP-DEV] [RFC][Draft] Body-less __construct

2021-05-10 Thread Hossein Baghayi
On Mon, 10 May 2021 at 21:59, Larry Garfield wrote: > 1) Please don't top-post. > > 2) The reason is that the old way doesn't provide any way to populate them > on construction. The pattern of "assign the arg to the prop in the > constructor" is stupendously common, and promotion makes it

Re: [PHP-DEV] [RFC][Draft] Body-less __construct

2021-05-10 Thread Hossein Baghayi
If constructor is supposed to be empty then why are we even bothering with construction promoting style? Why aren't we sticking to the old way of defining properties? Are there any advantages to using construction promoting style? I mean sure we could have this: class Foo { public function