Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:1951 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 31630 invoked from network); 23 May 2003 21:53:24 -0000 Received: from unknown (HELO mail-in2.inet.tele.dk) (194.182.148.151) by pb1.pair.com with SMTP; 23 May 2003 21:53:24 -0000 Received: from [192.168.1.6] (cpe.atm2-0-1021117.0x50a0faee.odnxx6.customer.tele.dk [80.160.250.238]) by mail-in2.inet.tele.dk (Postfix) with ESMTP id AEF4569B4; Fri, 23 May 2003 23:53:20 +0200 (CEST) To: Per Lundberg Cc: PHP Internals List In-Reply-To: <1053705633.1279.41.camel@salem.intra.nobolt.net> References: <1053704626.1035.21.camel@localhost.localdomain> <1053705633.1279.41.camel@salem.intra.nobolt.net> Content-Type: text/plain Organization: Message-ID: <1053726799.493.12.camel@marvin> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.3.1 (Preview Release) Date: 23 May 2003 23:53:20 +0200 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [PATCH] make "Call to a member function on a non-object" non-fatal From: morten+php@afdelingp.dk (Morten Poulsen) On Fri, 2003-05-23 at 18:00, Per Lundberg wrote: > I think this patch is bad. It distorts the control flow of a normal > program. Calling member functions on a non-object is a serious error, > so the only real option IMO is dying, or throwing an exception. The patch might not be the right way to implement it. Calling a member function on null happens from time to time, when programmers don't check the return value of a library call. In a production environment it is bad, not having the option to handle the error, therefore it is bad to just die. Throwing an exception might be a nicer way, but isn't that future? Best regards, Morten -- Morten Poulsen