RE: [PHP-DEV] Core functions throwing exceptions in PHP7

2015-08-01 Thread Anatol Belski
Hi Anthony, > -Original Message- > From: Anthony Ferrara [mailto:ircmax...@gmail.com] > Sent: Saturday, August 1, 2015 2:34 AM > To: Ferenc Kovacs > Cc: Sammy Kaye Powers ; internals@lists.php.net; Nikita > Popov > Subject: Re: [PHP-DEV] Core functions throwing exceptions in PHP7 > > Fe

Re: [PHP-DEV] Core functions throwing exceptions in PHP7

2015-08-01 Thread Niklas Keller
2015-08-01 1:43 GMT+02:00 Yasuo Ohgaki : > Hi Niklas, > > On Sat, Aug 1, 2015 at 8:27 AM, Yasuo Ohgaki wrote: > >> They should totally be handled. You need to catch the error and throw a >>> defined exception, otherwise your public API will break if you choose to >>> use another internal implemen

Re: [PHP-DEV] Re: Throwable::addSuppressed()

2015-08-01 Thread Markus Malkusch
Markus Malkusch: > 2) You are loosing one stack trace I'd like to revise that. I'd just learned that finally does indeed fit here, as it would automatically glue exceptions: try { throw new Exception("A"); } finally { throw new Exception("B"); } This prints both exceptions: PHP Fa

Re: [PHP-DEV] Core functions throwing exceptions in PHP7

2015-08-01 Thread Nikita Popov
On Sat, Aug 1, 2015 at 12:34 AM, Ferenc Kovacs wrote: > > > > On Tue, Jul 14, 2015 at 11:04 PM, Sammy Kaye Powers wrote: > >> Hello lovely PHP nerds, >> >> There are two open PR's for PHP7 to modify the behavior of the CSPRNG's: >> >> https://github.com/php/php-src/pull/1397 (main discussion) >>

Re: [PHP-DEV] Re: Throwable::addSuppressed()

2015-08-01 Thread Christoph Becker
Markus Malkusch wrote: > Markus Malkusch: > >> 2) You are loosing one stack trace > > I'd like to revise that. I'd just learned that finally does indeed fit > here, as it would automatically glue exceptions: > > try { > throw new Exception("A"); > > } finally { > throw new Exception("B

Re: [PHP-DEV] Re: Throwable::addSuppressed()

2015-08-01 Thread Markus Malkusch
Christoph Becker: > Markus Malkusch wrote: >> >> I'd like to revise that. I'd just learned that finally does indeed fit >> here, as it would automatically glue exceptions: [..] > Note that there's an open bug report () > regarding this issue. Thank you for pointing to

Re: [PHP-DEV] Re: Throwable::addSuppressed()

2015-08-01 Thread Stephen Coakley
On 08/01/2015 09:44 AM, Markus Malkusch wrote: Christoph Becker: Markus Malkusch wrote: I'd like to revise that. I'd just learned that finally does indeed fit here, as it would automatically glue exceptions: [..] Note that there's an open bug report () regarding

Re: [PHP-DEV] Core functions throwing exceptions in PHP7

2015-08-01 Thread Yasuo Ohgaki
Hi Niklas, On Sat, Aug 1, 2015 at 5:50 PM, Niklas Keller wrote: > You always assume the developer just wants to fallback to something > different. You can't > detect the environment btw. because it could just fail because of too many > open file descriptors. > This is not my assumption, but oth

Re: [PHP-DEV] Core functions throwing exceptions in PHP7

2015-08-01 Thread Scott Arciszewski
On Sat, Aug 1, 2015 at 6:37 AM, Nikita Popov wrote: > tl;dr: This should definitely throw, but I'm as yet unclear as to *what* it > should throw. My gut says zpp should throw Error, length/min/max errors > should throw Error and the randomness-not-available condition should throw > Exception. Hi

Re: [PHP-DEV] Re: Throwable::addSuppressed()

2015-08-01 Thread Stephen Coakley
On 08/01/2015 09:44 AM, Markus Malkusch wrote: Christoph Becker: Markus Malkusch wrote: I'd like to revise that. I'd just learned that finally does indeed fit here, as it would automatically glue exceptions: [..] Note that there's an open bug report () regarding

Re: [PHP-DEV] Exposing object handles to userland

2015-08-01 Thread Stanislav Malyshev
Hi! > I've been pinged many times to add a new spl_object_id() function to PHP, > that would return the internal object handle of an object. What would be the use of this? > Today, spl_object_hash() partially allows that, but adds many randomness to > the result, which is not very cool to use la

Re: [PHP-DEV] Exposing object handles to userland

2015-08-01 Thread Stanislav Malyshev
Hi! Some suspicious use of spl_object_hash() out there... > https://github.com/symfony/symfony/blob/master/src/Symfony/Component/VarDumper/Cloner/VarCloner.php Not sure what this one does... but calculations with spl_object_hash() look very suspicious. > > https://github.com/horde/horde/blob/