Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:22741 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 79992 invoked by uid 1010); 13 Apr 2006 22:57:13 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 79972 invoked from network); 13 Apr 2006 22:57:13 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Apr 2006 22:57:13 -0000 X-Host-Fingerprint: 204.11.219.139 lerdorf.com Linux 2.5 (sometimes 2.4) (4) Received: from ([204.11.219.139:59434] helo=lerdorf.com) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id FC/0A-19715-847DE344 for ; Thu, 13 Apr 2006 18:57:13 -0400 Received: from [66.228.175.145] (borndress-lm.corp.yahoo.com [66.228.175.145]) (authenticated bits=0) by lerdorf.com (8.13.6/8.13.6/Debian-1) with ESMTP id k3DMv8st026267; Thu, 13 Apr 2006 15:57:09 -0700 In-Reply-To: <7.0.1.0.2.20060413154916.014b1d88@zend.com> References: <7.0.1.0.2.20060413154916.014b1d88@zend.com> Mime-Version: 1.0 (Apple Message framework v623) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-ID: Content-Transfer-Encoding: 7bit Cc: Dmitry Stogov , PHP Internals Date: Thu, 13 Apr 2006 15:56:18 -0700 To: Andi Gutmans X-Mailer: Apple Mail (2.623) Subject: Re: Unicode conversion exceptions and memory leaks From: andrei@gravitonic.com (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 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 >