Re: [PHP-DEV] Serializing exceptions

2015-03-23 Thread Rowan Collins
Stanislav Malyshev wrote on 23/03/2015 05:21: Hi! Looking into some issue, I've discovered that, to my surprise, Exceptions are serializable. Except that it doesn't always work of course (e.g. see http://stackoverflow.com/q/9747813/214196) because exceptions contain backtraces, and those can con

RE: [PHP-DEV] Serializing exceptions

2015-03-23 Thread Christian Stoller
From: Stanislav Malyshev [mailto:smalys...@gmail.com], Sent: Monday, March 23, 2015 7:45 AM > Hi! > >> Maybe you can implement the __sleep method and just return the >> documented attributes (message, code, file, line). > >That would be an option, but before going there, my question is - does >an

Re: [PHP-DEV] Serializing exceptions

2015-03-22 Thread Stanislav Malyshev
Hi! > Maybe you can implement the __sleep method and just return the > documented attributes (message, code, file, line). That would be an option, but before going there, my question is - does anybody need it, really? -- Stas Malyshev smalys...@gmail.com -- PHP Internals - PHP Runtime Developm

Re: [PHP-DEV] Serializing exceptions

2015-03-22 Thread Stanislav Malyshev
Hi! > I think we should discuss if (un)serialization is a first-class > operation in the language and if so, we should try to make everything > serializable. Currently, we introduce more and more unserializable I don't think we can, not unless we can serialize PHP code (like Java can have JARs wi

Re: [PHP-DEV] Serializing exceptions

2015-03-22 Thread Dennis Birkholz
Hi, Am 23.03.2015 um 06:21 schrieb Stanislav Malyshev: > Looking into some issue, I've discovered that, to my surprise, > Exceptions are serializable. Except that it doesn't always work of > course (e.g. see http://stackoverflow.com/q/9747813/214196) because > exceptions contain backtraces, and th

AW: [PHP-DEV] Serializing exceptions

2015-03-22 Thread Robert Stoll
> -Ursprüngliche Nachricht- > Von: Pierre Joye [mailto:pierre@gmail.com] > Gesendet: Montag, 23. März 2015 06:57 > An: Juan Basso > Cc: Stanislav Malyshev; PHP Internals > Betreff: Re: [PHP-DEV] Serializing exceptions > > On Mon, Mar 23, 2015 at 12:31 PM, Juan

Re: [PHP-DEV] Serializing exceptions

2015-03-22 Thread Pierre Joye
On Mon, Mar 23, 2015 at 12:31 PM, Juan Basso wrote: > Maybe you can implement the __sleep method and just return the documented > attributes (message, code, file, line). > > Not perfect, but probably more useful than throw an exception, specially if > the exception is something that is the attribu

Re: [PHP-DEV] Serializing exceptions

2015-03-22 Thread Juan Basso
Maybe you can implement the __sleep method and just return the documented attributes (message, code, file, line). Not perfect, but probably more useful than throw an exception, specially if the exception is something that is the attribute of some object that is being serialized. Juan Basso On Mar

[PHP-DEV] Serializing exceptions

2015-03-22 Thread Stanislav Malyshev
Hi! Looking into some issue, I've discovered that, to my surprise, Exceptions are serializable. Except that it doesn't always work of course (e.g. see http://stackoverflow.com/q/9747813/214196) because exceptions contain backtraces, and those can contain non-serializable objects. So in reality, yo