Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:75994 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 57143 invoked from network); 24 Jul 2014 08:34:53 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Jul 2014 08:34:53 -0000 Authentication-Results: pb1.pair.com header.from=php@bof.de; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=php@bof.de; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain bof.de designates 80.242.145.70 as permitted sender) X-PHP-List-Original-Sender: php@bof.de X-Host-Fingerprint: 80.242.145.70 mars.intermailgate.com Received: from [80.242.145.70] ([80.242.145.70:46236] helo=mars.intermailgate.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 24/10-55265-925C0D35 for ; Thu, 24 Jul 2014 04:34:52 -0400 Received: (qmail 16600 invoked by uid 1009); 24 Jul 2014 10:34:49 +0200 Received: from 213.135.15.139 by mars (envelope-from , uid 89) with qmail-scanner-1.25-st-qms (clamdscan: 0.96.2/19216. spamassassin: 3.3.1. perlscan: 1.25-st-qms. Clear:RC:0(213.135.15.139):SA:0(-1.1/10.0):. Processed in 1.5507 secs); 24 Jul 2014 08:34:49 -0000 X-Spam-Status: No, hits=-1.1 required=10.0 X-Antivirus-MYDOMAIN-Mail-From: php@bof.de via mars X-Antivirus-MYDOMAIN: 1.25-st-qms (Clear:RC:0(213.135.15.139):SA:0(-1.1/10.0):. Processed in 1.5507 secs Process 16587) Received: from unknown (HELO rofl.localnet) (gmail@bof.de@213.135.15.139) by mars.intermailgate.com with AES256-SHA encrypted SMTP; 24 Jul 2014 10:34:48 +0200 To: internals@lists.php.net Cc: Pierre Joye , Andrea Faulds Date: Thu, 24 Jul 2014 10:33:24 +0200 Message-ID: <1914924.AS6fu4y4Km@rofl> User-Agent: KMail/4.11.5 (Linux/3.11.10-17-desktop; KDE/4.11.5; x86_64; ; ) In-Reply-To: References: <08503591-EFC8-48E6-984E-FFC292C5EA5F@ajf.me> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="nextPart82721445.KyFPpKM4hL" Content-Transfer-Encoding: 7Bit Subject: Re: [PHP-DEV] [RFC] Scalar Type Hinting With Casts (re-opening) From: php@bof.de (Patrick Schaaf) --nextPart82721445.KyFPpKM4hL Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" > The argument saying that it is not the PHP way is somehow incorrect > here, given that we already do that for classe. The type jungling > makes sense in implementations, as it always was but argument passing > and validation have been a source of pain since very long. I could > imagine one exception with the "numeric" type, which could accept > anything and got converted to integer/numeric values, like "1235ab" or > other weird things. Personal opinion of a nonvoter, just for the record :) The fact that roughly everybody in the strict-and-validation camp in the recent discussions, adds in a different view on "with the exception of", very very strongly suggests that the strict-and-validation POV is wrong wrong wrong. On the one hand, because calling code will become sprinkled with casts on function calls to coerce the arguments to conform to the strict interpretation. And on the other hand, because validation needs, for all practical purposes, are far more finegrained than any half-a-dozen-type scheme. So, I'm 100% in the cast camp, i.e. interpret scalar type annotation of function arguments as syntactic sugar for explicit casts at the beginning of the function. best regards Patrick --nextPart82721445.KyFPpKM4hL--