Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:80041 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 15446 invoked from network); 1 Jan 2015 12:41:12 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Jan 2015 12:41:12 -0000 Authentication-Results: pb1.pair.com smtp.mail=zeev@zend.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=zeev@zend.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 74.125.82.177 as permitted sender) X-PHP-List-Original-Sender: zeev@zend.com X-Host-Fingerprint: 74.125.82.177 mail-we0-f177.google.com Received: from [74.125.82.177] ([74.125.82.177:43888] helo=mail-we0-f177.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B9/C7-60454-76045A45 for ; Thu, 01 Jan 2015 07:41:12 -0500 Received: by mail-we0-f177.google.com with SMTP id q59so3393063wes.36 for ; Thu, 01 Jan 2015 04:41:07 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:references:in-reply-to:mime-version :thread-index:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=5HTsoPzbdc8Nk3FEyssKrQnzCZo0WJfFv5sbqHeMmYE=; b=D8Gn+tv8opuYOFvjXp5SuMjXxqRSr8SVrge2VKzZ1QKzVBfib68XCgZk1BU5bVLOdF LFi8wSEkE0seTwat37Yh9V6idqjo3ZF1NU9pqOnfCPN9paO4d0Lk4nQzdm3r5+V7QP6d 7LXJ+N5yizu73PBSO4RffW5vOZUbxrzNtGimLyXfwo9ARhsIi3JotBuhMOpJGp7fP0CN YZtFUNQMkbhZgGbMZG115kaZiPUeCVqv6BCc+uUJN522AJbXpUUkpEEV0VtDUZqRKoU4 fP1JjSAX7XXjnu0QIpjmrzKlT0bPeX7pvrJC9Y9oItb/I7qk2LRkr614c0HgbSDl4XuC O5TA== X-Gm-Message-State: ALoCoQlLBH2sIK7rhVJuYgI4F5aYvbFFe3j2WNzH5UeksbSZrbxose0a3daQWK4o3rA9PEApVd5cy7mwueAxRGo0/XINF0LnRgHUql0dWM+Ypb8EFdeZWHSMgIytkYl+q2LJtbjQNgNS99iRj1OT/7vl0Upxd98y+A== X-Received: by 10.180.85.33 with SMTP id e1mr121675652wiz.61.1420116066969; Thu, 01 Jan 2015 04:41:06 -0800 (PST) References: <41D5BB0B-73AF-488E-968D-90B2878E3178@ajf.me> In-Reply-To: <41D5BB0B-73AF-488E-968D-90B2878E3178@ajf.me> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQGEUxVom/MF8lo7irvbCgQdYKqgQJ1C1x4g Date: Thu, 1 Jan 2015 14:41:06 +0200 Message-ID: <16d442a345cf2cbd4faac6d068c57343@mail.gmail.com> To: Andrea Faulds Cc: PHP Internals Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: RE: [PHP-DEV] [RFC] Scalar Type Hints From: zeev@zend.com (Zeev Suraski) > -----Original Message----- > From: Andrea Faulds [mailto:ajf@ajf.me] > Sent: Wednesday, December 31, 2014 10:28 PM > To: PHP Internals > Subject: [PHP-DEV] [RFC] Scalar Type Hints > > Good evening, > > Parameter type hints for PHP=E2=80=99s scalar types are a long-requested = feature > for > PHP. Today I am proposing an RFC which is a new attempt to add them to > the language. It is my hope that we can finally get this done for PHP 7. Andrea, I like this draft too, and that's a first after countless proposals over th= e last decade - so kudos! :) My main feedback here are the discrepancies between this RFC's casting rule= s and PHP's current built-in casting rules. Ideally, I'd like those to be completely identical and not almost-identical. Since we're talking about v7.0, we do have the option of making changes to PHP's fundamental casting rules where appropriate (e.g. converting an array to a string). But that said, I think the way strings->numbers are handled - where they accept only numeric strings as it would mean you can't use casting to an int/float as an ultra-simple way to sanitize untrusted input. I would change the =E2=80=A0 section from: =E2=80=A0Non-numeric strings not accepted. Numeric strings with trailing ch= aracters are accepted, but produce a notice. to =E2=80=A0 Numeric strings with trailing characters and non-numeric strings = are accepted, but produce a notice. - and apply it to both this RFC and the infrastructure convert_to_*(), so that it applies across the board in PHP. Zeev