Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:59001 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 4448 invoked from network); 18 Mar 2012 11:12:15 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Mar 2012 11:12:15 -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:55453] helo=mail-ob0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E0/13-18036-C03C56F4 for ; Sun, 18 Mar 2012 06:12:12 -0500 Received: by obbup19 with SMTP id up19so507619obb.29 for ; Sun, 18 Mar 2012 04:12:09 -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=oy+NCjgNWENVr2H3t1CcDOaKVb5mAu4fDw+tf/wH3QM=; b=BfNPkOfwdsVbVboP6Mg2vs52gMFXrrnr6obaN8FZeVtrB6QE7Dbg4o6OyBUvqbS8hl BFiNSjXPhW5GgKFrJ2pQiUiRYgStXYzbr3je0W+xCJW5rJ9AhVLwTegXHdm3n1RToUHC x+OFTG4lunkQc745DaYfd3tpsE5b4/USzDHexHVDjGlbwN+aZh7qgsd4mnB5KE2ZUhSl zq1UBBGCwT5RvqM1Y49luxAF0XFRkUJyzBkMga9PMgtoQk+Kmu38e/FHVfPR8qnoumht li4fAWu3AxtoIlR3kaLl9Ouh9WkHmOB5SZ3GBJ2AX/+xCTIB6KRIuBDgcxzljEMcqUdg x38g== MIME-Version: 1.0 Received: by 10.182.188.38 with SMTP id fx6mr9155584obc.77.1332069129682; Sun, 18 Mar 2012 04:12:09 -0700 (PDT) Received: by 10.60.18.162 with HTTP; Sun, 18 Mar 2012 04:12:09 -0700 (PDT) In-Reply-To: References: Date: Sun, 18 Mar 2012 12:12:09 +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 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 interesting= ly, the *community* rejected it because it is useless. See the comments at = http://sebastian-bergmann.de/archives/900-Scalar-Type-Hints-in-PHP-5.3.99.h= tml for a good picture of why people hated this idea. Previous discussions = on this mailing list also point out that this idea would ultimately be a de= ad 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 Hi, All Just to add an example why I want a more strictly type-check here as we have in the current type-juggling: http://www.brandonsavage.net/an-xss-vulerability-in-the-making/?utm_source= =3Drss&utm_medium=3Drss&utm_campaign=3Dan-xss-vulerability-in-the-making Bye Simon