Re: [PHP-DEV] Re: Unicode conversion exceptions and memory leaks

2006-06-21 Thread Andrei Zmievski
I hope that my latest commits makes both camps happy. The handler signature is actually: function my_handler($direction, $encoding, $char_or_byte, $offset, $message) { .. } -Andrei On Apr 19, 2006, at 2:32 PM, Andrei Zmievski wrote: I've had some time to think about this and Derick and I

Re: [PHP-DEV] Re: Unicode conversion exceptions and memory leaks

2006-04-26 Thread Andrei Zmievski
Right. Throwing exceptions from output handler or INI reader may not be optimal. What did you think about the user defined error handler though? -Andrei On Apr 24, 2006, at 10:16 PM, Andi Gutmans wrote: I'm wondering whether it's technically feasible that any places where such a conversio

Re: [PHP-DEV] Re: Unicode conversion exceptions and memory leaks

2006-04-24 Thread Andi Gutmans
I'm wondering whether it's technically feasible that any places where such a conversion could fail would be allowed to throw an exception (i.e. internal functions, stream handlers, INI reader, etc...) At 02:36 PM 4/24/2006, Andrei Zmievski wrote: So, no particular opinions on this, aside from M

Re: [PHP-DEV] Re: Unicode conversion exceptions and memory leaks

2006-04-24 Thread Andrei Zmievski
So, no particular opinions on this, aside from Markus's? I hoped this proposal would mollify both camps.. -Andrei On Apr 19, 2006, at 2:32 PM, Andrei Zmievski wrote: I've had some time to think about this and Derick and I also kicked around some ideas in a private conversation. The situatio

Re: [PHP-DEV] Re: Unicode conversion exceptions and memory leaks

2006-04-20 Thread Markus Fischer
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Derick Rethans wrote: > http://files.derickrethans.nl/pseudoandrei Ah great, it was just not getting "the point". Sorry for the spam. - - Markus -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.2.1 (MingW32) Comment: Using GnuPG with Mozilla - http:

Re: [PHP-DEV] Re: Unicode conversion exceptions and memory leaks

2006-04-20 Thread Derick Rethans
On Thu, 20 Apr 2006, Markus Fischer wrote: > Andrei Zmievski wrote: > > The best Derick and I could come up with is a user-specified conversion > > error handler. It would be invoked only when the converter encounters an > > illegal sequence or other serious error. The existing subst, skip, etc >

Re: [PHP-DEV] Re: Unicode conversion exceptions and memory leaks

2006-04-19 Thread Markus Fischer
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Andrei Zmievski wrote: > The best Derick and I could come up with is a user-specified conversion > error handler. It would be invoked only when the converter encounters an > illegal sequence or other serious error. The existing subst, skip, etc > error

[PHP-DEV] Re: Unicode conversion exceptions and memory leaks

2006-04-19 Thread Andrei Zmievski
I've had some time to think about this and Derick and I also kicked around some ideas in a private conversation. The situation I am talking about is really about exceptional circumstances, such as ISO-8859-1 string being treated as a UTF-8 one or some other condition that results in illegal se

Re: [PHP-DEV] RE: Unicode conversion exceptions and memory leaks

2006-04-14 Thread Pierre
On 4/14/06, Michael Wallner <[EMAIL PROTECTED]> wrote: > Pierre wrote: > > > Same here, and even if PHP will allow it. String manipulations > > (unicode included) must remain a quiet and easy operation. This should > > be a goal for each extensions, give a way to make PHP silent (by > > default or

Re: [PHP-DEV] RE: Unicode conversion exceptions and memory leaks

2006-04-14 Thread Ilia Alshanetsky
On 14-Apr-06, at 1:55 PM, Michael Wallner wrote: Pierre wrote: Same here, and even if PHP will allow it. String manipulations (unicode included) must remain a quiet and easy operation. This should be a goal for each extensions, give a way to make PHP silent (by default or not does not matt

Re: [PHP-DEV] RE: Unicode conversion exceptions and memory leaks

2006-04-14 Thread Michael Wallner
Pierre wrote: Same here, and even if PHP will allow it. String manipulations (unicode included) must remain a quiet and easy operation. This should be a goal for each extensions, give a way to make PHP silent (by default or not does not matter but it must be settable). So let's go ahead and ge

Re: [PHP-DEV] RE: Unicode conversion exceptions and memory leaks

2006-04-14 Thread Andrei Zmievski
We had a .. bit of discussion on IRC about this. I will post my reply soon, once I've had sufficient time to cool down. -Andrei On Apr 14, 2006, at 9:50 AM, Andi Gutmans wrote: Amen. At 09:40 AM 4/14/2006, Pierre wrote: On 4/14/06, Dmitry Stogov <[EMAIL PROTECTED]> wrote: > In general, exce

Re: [PHP-DEV] RE: Unicode conversion exceptions and memory leaks

2006-04-14 Thread Andi Gutmans
Amen. At 09:40 AM 4/14/2006, Pierre wrote: On 4/14/06, Dmitry Stogov <[EMAIL PROTECTED]> wrote: > In general, exceptions as result of type conversion are good. I disagree here, exceptions are... exceptions. That means they should be used in rare cases. Unicode (and string manipulation in gerena

Re: [PHP-DEV] RE: Unicode conversion exceptions and memory leaks

2006-04-14 Thread Pierre
On 4/14/06, Dmitry Stogov <[EMAIL PROTECTED]> wrote: > In general, exceptions as result of type conversion are good. I disagree here, exceptions are... exceptions. That means they should be used in rare cases. Unicode (and string manipulation in gerenal) should not use exceptions. I see no cases w

Re: [PHP-DEV] RE: Unicode conversion exceptions and memory leaks

2006-04-14 Thread Andi Gutmans
At 03:51 AM 4/14/2006, Derick Rethans wrote: On Fri, 14 Apr 2006, Dmitry Stogov wrote: > In general, exceptions as result of type conversion are good. > But they does NOT work in PHP, because of exception mechanism > design/implementation. > > Half year ago we disabled exceptions in __toString()

Re: [PHP-DEV] RE: Unicode conversion exceptions and memory leaks

2006-04-14 Thread Derick Rethans
On Fri, 14 Apr 2006, Dmitry Stogov wrote: > In general, exceptions as result of type conversion are good. > But they does NOT work in PHP, because of exception mechanism > design/implementation. > > Half year ago we disabled exceptions in __toString() especially because of > this reason. > I pref

[PHP-DEV] RE: Unicode conversion exceptions and memory leaks

2006-04-13 Thread Dmitry Stogov
In general, exceptions as result of type conversion are good. But they does NOT work in PHP, because of exception mechanism design/implementation. Half year ago we disabled exceptions in __toString() especially because of this reason. I prefer disable exceptions for unicode conversions too. Thank

Re: [PHP-DEV] Re: Unicode conversion exceptions and memory leaks

2006-04-13 Thread Jochem Maas
Andi Gutmans wrote: As you know, exceptions were designed to be user-land and not for internal functionality. I warned about that more exceptions were being integrated into the extensions; and I especially warned of ideas of integrating them into language constructs such as type hints and conv

[PHP-DEV] Re: Unicode conversion exceptions and memory leaks

2006-04-13 Thread Andi Gutmans
Yeah but we can't only tailor to the default. If you cast "abc" to an integer today PHP will do the conversion (e.g. 0). I think we should stick to that paradigm and provide users with validation methods if they want to strictly validate... Andi At 03:56 PM 4/13/2006, Andrei Zmievski wrote: B

[PHP-DEV] Re: Unicode conversion exceptions and memory leaks

2006-04-13 Thread Andrei Zmievski
By default type conversions will just output a warning. You will get exceptions if you set the U_CONV_ERROR_EXCEPTION flag. -Andrei On Apr 13, 2006, at 3:52 PM, Andi Gutmans wrote: As you know, exceptions were designed to be user-land and not for internal functionality. I warned about that mo

[PHP-DEV] Re: Unicode conversion exceptions and memory leaks

2006-04-13 Thread Andi Gutmans
As you know, exceptions were designed to be user-land and not for internal functionality. I warned about that more exceptions were being integrated into the extensions; and I especially warned of ideas of integrating them into language constructs such as type hints and conversions. I don't have