[PHP-DEV] RFC: Allow throwing an exception as right part of null coalescing operator

2017-07-24 Thread Tim Bezhashvyly
Dear internals, Don't you think allowing to throw an exception as the right side of null coalescing operator would be a good idea? Something like: echo $a ?? throw new \RuntimeException('foo'); Regards, Tim -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://w

Re: [PHP-DEV] [RFC][DISCUSSION] - Disallow Multiple Constructor Calls

2017-01-17 Thread Tim Bezhashvyly
construct().": > Do we really need to introduce more language constructs that look like valid > user space code https://3v4l.org/CE2q8 <https://3v4l.org/CE2q8> ? > > Thanks. > Márcio. > > 2017-01-17 16:17 GMT-04:00 Tim Bezhashvyly <mailto:tim.bezhashv...@gmail.com>&g

Re: [PHP-DEV] [RFC][DISCUSSION] - Disallow Multiple Constructor Calls

2017-01-17 Thread Tim Bezhashvyly
Hi Nikita, thank you for your feedback. Would you suggest to convert RFC into prohibition of explicit __construct calls except parent::__construct? Regards, Tim > On 17 Jan 2017, at 21:48, Nikita Popov wrote: > > On Tue, Jan 17, 2017 at 9:17 PM, Tim Bezhashvyly <mailto:

[PHP-DEV] [RFC][DISCUSSION] - Disallow Multiple Constructor Calls

2017-01-17 Thread Tim Bezhashvyly
Dear internals, me and Richard Fussenegger came up with a RFC draft disallowing multiple constructor calls - https://wiki.php.net/rfc/disallow-multiple-constructor-calls Here is a Reddit discussion thread - https://www.reddit.com/

Re: [PHP-DEV] Explicit constructor call and polymorphic dispatch

2017-01-12 Thread Tim Bezhashvyly
e(); > >// irrelevant from here on >return ['query' => $queryString, 'dsn' => $this->dsn]; > } > > } > > $instance = DbConnection::lazyInstance('mysql://something'); > > var_dump($instance); > > var_dump($instance-&

Re: [PHP-DEV] Explicit constructor call and polymorphic dispatch

2017-01-12 Thread Tim Bezhashvyly
> The same can be used in a myriad of different ways, but this is a legit > use-cases that generally don't involve coding everything into the same class > (and I generally advise against doing that anyway). > > Therefore I don't see a reason to drop manual constructor

[PHP-DEV] Explicit constructor call and polymorphic dispatch

2017-01-11 Thread Tim Bezhashvyly
Dear internals, I would like to propose 2 RFCs: - Disallow explicit call of __construct method - Polymorphic dispatch I'm sure I'm not the first who came with those 2 ideas so in case those were already proposed and rejected just let me know. Otherwise please bless me with mana which will allo

[PHP-DEV] Drop map/reduction/filter warnings

2016-02-02 Thread Tim Bezhashvyly
Dear internals, I would like to propose the following RFC: If an exception is thrown inside array_reduce, array_map, array_filter, etc callback don't flush meaningless warnings like: > An error occurred while invoking the reduction callback ... but pass an exception from a closure outside. Cu

[PHP-DEV] Typed Arrays in Scalar Types RFC

2015-06-23 Thread Tim Bezhashvyly
Dear internals, I would like to submit an RFC for supporting typed arrays as function/method argument and return types. Please either throw stones at me or give me enough karma to post it. My php.net <http://php.net/> username is tim-bezhashvyly. Regards, Tim

Re: [PHP-DEV] RFC Proposal

2015-05-27 Thread Tim Bezhashvyly
Dear internals, after cooling down and encouraged by François (thank a lot for this) I decided to submit an RFC regarding immutable variable only. Would appreciate if you will grant me some karma to do it. Regards, Tim > On 18 Feb 2015, at 10:44, Tim Bezhashvyly wrote: > > Dear

Re: [PHP-DEV] RFC Proposal

2015-02-18 Thread Tim Bezhashvyly
On Tue, Feb 17, 2015 at 8:35 PM, Tim Bezhashvyly <mailto:tim.bezhashv...@gmail.com>> wrote: > Dear PHP internals, > > this is my first RFC proposal and I am not sure if in this email is supposed > to contain all RFC details or just a brief idea .. which is to drop PHP > c

[PHP-DEV] RFC Proposal

2015-02-17 Thread Tim Bezhashvyly
Dear PHP internals, this is my first RFC proposal and I am not sure if in this email is supposed to contain all RFC details or just a brief idea .. which is to drop PHP constants in favour of “final" immutable variables. This is basically only a concept but I can also handle its implementation.