Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:73840 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 51982 invoked from network); 29 Apr 2014 08:26:40 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Apr 2014 08:26:40 -0000 Authentication-Results: pb1.pair.com smtp.mail=derick@php.net; spf=unknown; sender-id=unknown Authentication-Results: pb1.pair.com header.from=derick@php.net; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 82.113.146.227 as permitted sender) X-PHP-List-Original-Sender: derick@php.net X-Host-Fingerprint: 82.113.146.227 xdebug.org Linux 2.6 Received: from [82.113.146.227] ([82.113.146.227:47064] helo=xdebug.org) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 08/62-29159-D326F535 for ; Tue, 29 Apr 2014 04:26:39 -0400 Received: from localhost (localhost [IPv6:::1]) by xdebug.org (Postfix) with ESMTPS id 243D8EA0A6; Tue, 29 Apr 2014 09:26:35 +0100 (BST) Date: Tue, 29 Apr 2014 09:26:34 +0100 (BST) X-X-Sender: derick@whisky.home.derickrethans.nl To: "php@thekid.de" cc: internals@lists.php.net In-Reply-To: <1005082480.406481.1398600039315.open-xchange@email.1und1.de> Message-ID: References: <1005082480.406481.1398600039315.open-xchange@email.1und1.de> User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="8323329-905289440-1398759995=:4404" Subject: Re: [PHP-DEV] RFC: Catchable "call to a member function of a non-object" From: derick@php.net (Derick Rethans) --8323329-905289440-1398759995=:4404 Content-Type: TEXT/PLAIN; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE On Sun, 27 Apr 2014, php@thekid.de wrote: > Hello everyone, >=20 > as per the RFC process I'd like to start a discussion on the RFC > I've put up on the RFC Wiki: >=20 > =C2=A0 https://wiki.php.net/rfc/catchable-call-to-member-of-non-object > =C2=A0 RFC: Catchable "call to a member function of a non-object", 1.0 >=20 > The essence of this pull request is that it converts this fatal error > into E_RECOVERABLE_ERRORs. Framework authors may choose to convert > these into exceptions, as they already do with argument type mismatches. >=20 > Feedback is welcome! Besides the technical issues that Johannes already mentions, I am also=20 against this for logic reasons. Calling methods on NULL objects is a programming mistake. You either=20 have a bug in the code that creates the objects, and in cases where it=20 is somethings OK to not have an object, you forgot to check whether you=20 have an objects. Programming mistakes should not be hidden by error=20 handlers. cheers, Derick --=20 http://derickrethans.nl | http://xdebug.org Like Xdebug? Consider a donation: http://xdebug.org/donate.php twitter: @derickr and @xdebug Posted with an email client that doesn't mangle email: alpine --8323329-905289440-1398759995=:4404--