Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:58187 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 49591 invoked from network); 27 Feb 2012 20:08:31 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Feb 2012 20:08:31 -0000 Authentication-Results: pb1.pair.com header.from=johannes@schlueters.de; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=johannes@schlueters.de; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain schlueters.de from 217.114.211.66 cause and error) X-PHP-List-Original-Sender: johannes@schlueters.de X-Host-Fingerprint: 217.114.211.66 config.schlueters.de Received: from [217.114.211.66] ([217.114.211.66:34663] helo=config.schlueters.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C9/64-29394-DB2EB4F4 for ; Mon, 27 Feb 2012 15:08:30 -0500 Received: from [192.168.2.230] (ppp-93-104-28-210.dynamic.mnet-online.de [93.104.28.210]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by config.schlueters.de (Postfix) with ESMTPSA id 53AA860215; Mon, 27 Feb 2012 21:08:24 +0100 (CET) To: Gustavo Lopes Cc: Richard Lynch , "internals@lists.php.net" In-Reply-To: References: <41055a3dd36db02d3d09012231787a8d.squirrel@www.l-i-e.com> <4F4BB316.6080600@gmail.com> <2b2726ae802163c88909a8e4e161d246.squirrel@www.l-i-e.com> <1330369748.2159.49.camel@guybrush> Content-Type: text/plain; charset="UTF-8" Date: Mon, 27 Feb 2012 21:08:23 +0100 Message-ID: <1330373303.2159.51.camel@guybrush> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] Scalar type hinting From: johannes@schlueters.de (Johannes =?ISO-8859-1?Q?Schl=FCter?=) On Mon, 2012-02-27 at 21:05 +0100, Gustavo Lopes wrote: > On Mon, 27 Feb 2012 20:09:08 +0100, Johannes Schlüter > wrote: > > > On Mon, 2012-02-27 at 13:05 -0600, Richard Lynch wrote: > >> > >> I'd have to come up with some OTHER scenario not involving fatal > >> error, such as: > >> > >> strict $db = new DB(); > > > > The example is wrong. The new operator will always return an instance of > > the given class (or there will be an exception). > > [...] > > > This is not true. The new operator can return NULL. In fact, the intl > extension uses this extensively: ok, internal stuff can do everything it wants. But it shouldn't. Doing that is really bad and I wasn't aware of that case. :-) And since it's bad another example should be used :-) johannes