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

2017-07-24 Thread Niklas Keller
> > 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 > Sometimes that would be really helpful. What you can do is someth

[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