Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:52405 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 38804 invoked from network); 16 May 2011 19:23:27 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 May 2011 19:23:27 -0000 Authentication-Results: pb1.pair.com smtp.mail=smalyshev@sugarcrm.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=smalyshev@sugarcrm.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain sugarcrm.com designates 207.97.245.133 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 207.97.245.133 smtp133.iad.emailsrvr.com Linux 2.6 Received: from [207.97.245.133] ([207.97.245.133:44538] helo=smtp133.iad.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 02/11-26716-EA971DD4 for ; Mon, 16 May 2011 15:23:27 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp23.relay.iad1a.emailsrvr.com (SMTP Server) with ESMTP id 7C2CB3481F7; Mon, 16 May 2011 15:23:24 -0400 (EDT) X-Virus-Scanned: OK Received: by smtp23.relay.iad1a.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id 8EB6A34825F; Mon, 16 May 2011 15:23:23 -0400 (EDT) Message-ID: <4DD179AA.6010509@sugarcrm.com> Date: Mon, 16 May 2011 12:23:22 -0700 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 MIME-Version: 1.0 To: Anthony Ferrara CC: Andrew Curioso , =?ISO-8859-1?Q?Johannes_S?= =?ISO-8859-1?Q?chl=FCter?= , "internals@lists.php.net" References: <1305570720.1344.535.camel@guybrush> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Inconsistencies with constructors in SPL From: smalyshev@sugarcrm.com (Stas Malyshev) Hi! > Personally, I really don't care for something like this. Would it be > caught by a __call declaration if one existed (since it is a call to > an undefined method)? Would you expect it to? No and no. __call is not called for ctors, for obvious reasons (__call is an object method, and before ctor is done the object is not ready). It was always this way. > I'd rather see calls to non-existent methods generate a catachable > fatal error (rather than a hard fatal error that's currently thrown). Personally, I like this "catchable fatal error" business less and less. It's an awkward way of doing an exception with all exception downsides and none of the upsides... > But silently ignoring a called function, something just doesn't sit > right about that... We're already doing it :) Try: class Foo {} $a = new Foo(); You just ignored a non-existing ctor. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227