Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:58818 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 90722 invoked from network); 9 Mar 2012 13:21:43 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Mar 2012 13:21:43 -0000 Authentication-Results: pb1.pair.com smtp.mail=johncrenshaw@priacta.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=johncrenshaw@priacta.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain priacta.com designates 64.95.72.241 as permitted sender) X-PHP-List-Original-Sender: johncrenshaw@priacta.com X-Host-Fingerprint: 64.95.72.241 mxout.myoutlookonline.com Received: from [64.95.72.241] ([64.95.72.241:22312] helo=mxout.myoutlookonline.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id CA/5D-10820-6E30A5F4 for ; Fri, 09 Mar 2012 08:21:43 -0500 Received: from mxout.myoutlookonline.com (localhost [127.0.0.1]) by mxout.myoutlookonline.com (Postfix) with ESMTP id 6C86C7E75C2; Fri, 9 Mar 2012 08:21:40 -0500 (EST) X-Virus-Scanned: by SpamTitan at mail.lan Received: from HUB015.mail.lan (unknown [10.110.2.1]) by mxout.myoutlookonline.com (Postfix) with ESMTP id 10BF17E7579; Fri, 9 Mar 2012 08:21:40 -0500 (EST) Received: from MAILR001.mail.lan ([10.110.18.27]) by HUB015.mail.lan ([10.110.17.15]) with mapi; Fri, 9 Mar 2012 08:21:16 -0500 To: Anthony Ferrara , Lazare Inepologlou CC: "internals@lists.php.net" Date: Fri, 9 Mar 2012 08:21:24 -0500 Thread-Topic: [PHP-DEV] [POC - Patch] Scalar Type Hinting - A-La zend_parse_parameters Thread-Index: Acz98WslKFXh8osvTOqRgFTTdqEehwABRuaw Message-ID: References: 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] [POC - Patch] Scalar Type Hinting - A-La zend_parse_parameters From: johncrenshaw@priacta.com (John Crenshaw) > > (Now, it would be nice to have another RFC about custom object casting= =20 > > to int, float and bool...) > > You mean like https://wiki.php.net/rfc/object_cast_to_types which is stil= l in draft? > > Note that __toBool would be problematic, since it would be called if the = object was used in an if statement, which could yield some very strange res= ults if it returned false (it would break the existing semantics about how = we can use if statements to determine if the type is populated)... > > Anthony And yet, __toBool probably sits right next to __toArray in terms of the lev= el of usefulness (maybe even beats it.) isset() can always be used to deter= mine whether something was ACTUALLY set to a non-null value, and to some ex= tent there is already a semantic problem anyway since things like if("0") r= esolve to false. John Crenshaw Priacta, Inc.