Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:58206 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 79249 invoked from network); 27 Feb 2012 22:28:11 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Feb 2012 22:28:11 -0000 Authentication-Results: pb1.pair.com header.from=johncrenshaw@priacta.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=johncrenshaw@priacta.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain priacta.com designates 64.95.72.244 as permitted sender) X-PHP-List-Original-Sender: johncrenshaw@priacta.com X-Host-Fingerprint: 64.95.72.244 mxout.myoutlookonline.com Received: from [64.95.72.244] ([64.95.72.244:58447] helo=mxout.myoutlookonline.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F8/70-11273-A730C4F4 for ; Mon, 27 Feb 2012 17:28:10 -0500 Received: from mxout.myoutlookonline.com (localhost [127.0.0.1]) by mxout.myoutlookonline.com (Postfix) with ESMTP id 0B0208BF0E8; Mon, 27 Feb 2012 17:28:08 -0500 (EST) X-Virus-Scanned: by SpamTitan at mail.lan Received: from HUB025.mail.lan (unknown [10.110.2.1]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by mxout.myoutlookonline.com (Postfix) with ESMTPS id 7B19B8BF186; Mon, 27 Feb 2012 17:28:07 -0500 (EST) Received: from MAILR001.mail.lan ([10.110.18.27]) by HUB025.mail.lan ([10.110.17.25]) with mapi; Mon, 27 Feb 2012 17:28:00 -0500 To: John LeSueur , Kris Craig CC: Anthony Ferrara , Ferenc Kovacs , Michael Morris , "internals@lists.php.net" Date: Mon, 27 Feb 2012 17:28:03 -0500 Thread-Topic: [PHP-DEV] Scalar type hinting Thread-Index: Acz1hv4jxN+zFF2cTyis3+L5qq+CsQAECCTA Message-ID: References: <1330357150.2159.30.camel@guybrush> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: RE: [PHP-DEV] Scalar type hinting From: johncrenshaw@priacta.com (John Crenshaw) > -----Original Message----- > From: John LeSueur [mailto:john.lesueur@gmail.com]=20 >=20 > Maybe this discussion should start from the end of the last discussion on= non-strict type hints, where really smart people came up with some options= to handle the conversion: >=20 > https://wiki.php.net/rfc/typecheckingstrictandweak#option_1_current_type_= juggeling_rules_with_e_strict_on_data_loss >=20 > The RFC talks about throwing E_STRICT or E_FATAL, and has a couple of opt= ions for a matrix of conversion rules. I've actually read that proposal. To some level it is good, but I felt like= there were too many problems. E_ERROR is overkill. For comparison, (functi= on (array $bar) {})('a') generates a catchable fatal error (E_RECOVERABLE_E= RROR) so that's the furthest this should go in any case, but when dealing w= ith jugglable types and there's just some unexpected data loss even E_RECOV= ERABLE_ERROR is too much IMO; E_WARNING or E_NOTICE would be more appropria= te. IIRC it also failed conversions too aggressively. John Crenshaw Priacta, Inc.