Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:22742 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 86662 invoked by uid 1010); 13 Apr 2006 23:03:08 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 86647 invoked from network); 13 Apr 2006 23:03:08 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Apr 2006 23:03:08 -0000 X-Host-Fingerprint: 80.74.107.235 mail.zend.com Linux 2.5 (sometimes 2.4) (4) Received: from ([80.74.107.235:53987] helo=mail.zend.com) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 7A/2B-19715-BA8DE344 for ; Thu, 13 Apr 2006 19:03:08 -0400 Received: (qmail 11515 invoked from network); 13 Apr 2006 23:03:03 -0000 Received: from localhost (HELO ANDI-NOTEBOOK.zend.com) (127.0.0.1) by localhost with SMTP; 13 Apr 2006 23:03:03 -0000 Message-ID: <7.0.1.0.2.20060413160149.03eb5d00@zend.com> X-Mailer: QUALCOMM Windows Eudora Version 7.0.1.0 Date: Thu, 13 Apr 2006 16:02:58 -0700 To: Andrei Zmievski Cc: Dmitry Stogov ,PHP Internals In-Reply-To: References: <7.0.1.0.2.20060413154916.014b1d88@zend.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Subject: Re: Unicode conversion exceptions and memory leaks From: andi@zend.com (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: >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 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 a good solution for this right now, except for adding >>a lot of bulk to C extensions and the core and making them overly >>complicated. Anyway, I'll discuss with Dmitry and see if he has any >>ideas I didn't think of. >> >>re: this specific case. Is it really a good idea for a type >>conversion to throw an exception? People won't be expecting that >>from reading the code. They'd most likely only expect methods to >>throw exceptions... >> >>Andi