Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:58807 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 51403 invoked from network); 9 Mar 2012 07:51:56 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Mar 2012 07:51:56 -0000 Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@googlemail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=nikita.ppv@googlemail.com; 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:64620] helo=mail-lpp01m010-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2E/46-10820-A96B95F4 for ; Fri, 09 Mar 2012 02:51:55 -0500 Received: by lahl5 with SMTP id l5so1483913lah.29 for ; Thu, 08 Mar 2012 23:51:51 -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; bh=M4bg4WH0gfk8nGIbpGn9dvBwYpTKbdgCWO8pJFaq8BU=; b=Zh1OmFaup1Hs50W5mqd6qKEv/+a7o8gv4CMTlWcqVX7gsPKLUwNfUTpwG/qDFRPlJZ 93qWTBpv3v1sUbLwN78HLhQDFSmxzRGO00rRmeP8JYbSj5JR6Vf37A4vtKqZkvIJ9qPs /f8CS5W5RcQvvJbEl/OytKUnluUUvFpsrvI/NgXBFQ4kHnWv+ouLbYOh/Mt9P65c77aX Zngkua89USl69JfswGxwt7W3ib4p9yR9USWzUb2rrTQkB9y/vbzn82US5rmiOnsLzqll 5Cwh7638SDLeGQmBwDCegtVoCWFsrmtSBMxrQCY8l2FxDSuS0R0EzBV2/NuO7I0fKiUI Ojog== MIME-Version: 1.0 Received: by 10.112.47.225 with SMTP id g1mr441841lbn.52.1331279511358; Thu, 08 Mar 2012 23:51:51 -0800 (PST) Received: by 10.152.127.68 with HTTP; Thu, 8 Mar 2012 23:51:51 -0800 (PST) In-Reply-To: References: Date: Fri, 9 Mar 2012 08:51:51 +0100 Message-ID: To: Ilia Alshanetsky Cc: Anthony Ferrara , internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1 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:58 AM, Ilia Alshanetsky wrote: > Anthony, > > My concern with this type of patch is that what you are proposing are > not really hints, they are forced casts. As such they modify the data > potentially leading to data loss. This patch specifically tries to overcome this problem of the previous version. It will not accept input which will lead to a data loss on cast. The only exception is passing "123abc" to an int hint, which will cast to 123 and throw a notice. This is also my only point of critique: I'd prefer to be stricter here and go all the way to a recoverable fatal error. Nikita