Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:58808 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 53589 invoked from network); 9 Mar 2012 08:11:00 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Mar 2012 08:11:00 -0000 Authentication-Results: pb1.pair.com header.from=nikita.ppv@googlemail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@googlemail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain googlemail.com designates 209.85.215.42 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@googlemail.com X-Host-Fingerprint: 209.85.215.42 mail-lpp01m010-f42.google.com Received: from [209.85.215.42] ([209.85.215.42:33909] helo=mail-lpp01m010-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B9/A6-10820-21BB95F4 for ; Fri, 09 Mar 2012 03:10:59 -0500 Received: by lahl5 with SMTP id l5so1496452lah.29 for ; Fri, 09 Mar 2012 00:10:56 -0800 (PST) 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=eVJtJmXZQi9a5CCrvaVnVmmQprMKaI9H/CqOMql5CcY=; b=0log/2xtC10ZmoHFN5o4KJY7kl6uMOrP2euyoNAZtM4TJY5o5a+Yz6ruCMi4xBvruc qKVeqrznWmCbwXh+z3kEZ8ebfy9V16vWaXZoa/+2NMfjztbIqORk3o6iSHIC3N0z49vw HWBndUJzMx/X0gB6RYC59y4a5JjB/KhWUA2zpMuo87dUT2jC1+QF7Xiyd2gjwYkc3cfR A7jUbIjs9ne8lUzOu/bqVImJeRq7kkve3ihvlGYZ1WgJOOYcwezp+FpWQgVfGmcbUtHG f+5m0lYVTHvSwyyRP8+Gf/pHGhz5Q04r4W+pDMlqO//l/9/CdJuYghDrIBgTUKBmTyo4 Wghg== MIME-Version: 1.0 Received: by 10.112.42.72 with SMTP id m8mr484968lbl.10.1331280656153; Fri, 09 Mar 2012 00:10:56 -0800 (PST) Received: by 10.152.127.68 with HTTP; Fri, 9 Mar 2012 00:10:56 -0800 (PST) In-Reply-To: References: Date: Fri, 9 Mar 2012 09:10:56 +0100 Message-ID: To: Anthony Ferrara Cc: internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] [POC - Patch] Scalar Type Hinting - A-La zend_parse_parameters From: nikita.ppv@googlemail.com (Nikita Popov) On Fri, Mar 9, 2012 at 3:32 AM, Anthony Ferrara wrote= : > Hey all, > > As promised, I've created a POC patch to implement scalar type hints, > the way that zend_parse_parameters handles hinting. =A0First off, here's > the patch: Thanks for all the hard work you're putting into this :) > So, what do you think? This is the proposal I like most. It allows for some type juggling, but blocks off the ugly edge cases where dataloss would occur. Thinking in that direction I'd say that the casting rules are still too lax though: a) I'm not sure that we really want to accept '123abc' on an int cast with just a notice. In my eyes that is clearly malformed input, which should not be accepted. b) The bool cast rules also accept lots of input with dataloss. At least the fact that "abc" is considered a valid bool seems odd. Nikita