Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:58999 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 838 invoked from network); 18 Mar 2012 10:42:03 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Mar 2012 10:42:03 -0000 Authentication-Results: pb1.pair.com smtp.mail=simonsimcity@googlemail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=simonsimcity@googlemail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain googlemail.com designates 209.85.214.170 as permitted sender) X-PHP-List-Original-Sender: simonsimcity@googlemail.com X-Host-Fingerprint: 209.85.214.170 mail-ob0-f170.google.com Received: from [209.85.214.170] ([209.85.214.170:32910] helo=mail-ob0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B4/62-18036-AFBB56F4 for ; Sun, 18 Mar 2012 05:42:02 -0500 Received: by obbup19 with SMTP id up19so499337obb.29 for ; Sun, 18 Mar 2012 03:41:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=AJfD20p3JJklgyvqCZtSHq1pERd0ZJmr3Xehp9kkpuU=; b=uMHV4Vyhx7QTL7YgGm7F9F/gY1OZNfKzVSrVkFluv+OYlmALys1c1H/+uFdRE0kCw1 HlVSL9bKU/RZQe6XQOWrmHiiJTZlPbRE8IxkomVp05IfoicCWdsN9Da0YzfMjr9uEXgL ru3AC+w7Lh91lv+OpDFEar7oNwF4we5DwuHraX3m66ux15oaL9L9KxSXf5UVyV0yuld6 K/4iWPSsj5ZLN7C5qgQvaI/R/nZ1DQ1aY2qH3nf5RZbB2RNRjoEO2BDVvI3QcEOFAHae dV6qe6Wj+paYfxDStVvuQyi5TTmGLakWlImMs9pt7JtYtkuyfONWwUTKw7prFqmEhROt KGTA== MIME-Version: 1.0 Received: by 10.182.75.98 with SMTP id b2mr9130924obw.57.1332067319727; Sun, 18 Mar 2012 03:41:59 -0700 (PDT) Received: by 10.60.18.162 with HTTP; Sun, 18 Mar 2012 03:41:59 -0700 (PDT) In-Reply-To: References: Date: Sun, 18 Mar 2012 11:41:59 +0100 Message-ID: To: John Crenshaw Cc: Marco Pivetta , PHP Internals List Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Scalar-type-hinting - which way is the best to go? From: simonsimcity@googlemail.com (Simon Schick) 2012/3/18 John Crenshaw : > >> =C2=A0 =C2=A0 =C2=A0 2. Unenforced type hinting: > > This almost happened in 5.4, but eventually got pulled. More interestingl= y, the *community* rejected it because it is useless. See the comments at h= ttp://sebastian-bergmann.de/archives/900-Scalar-Type-Hints-in-PHP-5.3.99.ht= ml for a good picture of why people hated this idea. Previous discussions o= n this mailing list also point out that this idea would ultimately be a dea= d end (a very good catch by...someone...). > Hi, John Thanks for clarifying that way. I understand why some people want to have that ... to please really all people ... make a solution that fits for EVERYONE. But that would (on the other hand) cause way more confusion if you're working with different projects (using Sebastian Bergmanns example) ... one implementing this the way we would implement "Strict type hinting" - because that's what he wants ... and another one is implementing it as "Casting weak type hinting" ... and so on. I know that the user still has to add some code, but I don't like the fact to have additional type-hinting that's just doing nothing - and the user is then adding it if he wants. I'm still for the 3rd solution as it is most likely the current type-hint and is not that strict as the first solution. Just to have it consistent. What I like most here: All parameters that can be converted to the wanted format without loosing something are accepted, all other will stop the execution of the script. Bye Simon