Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:83528 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 25901 invoked from network); 23 Feb 2015 01:57:55 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Feb 2015 01:57:55 -0000 Authentication-Results: pb1.pair.com smtp.mail=jgmdev@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=jgmdev@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.48 as permitted sender) X-PHP-List-Original-Sender: jgmdev@gmail.com X-Host-Fingerprint: 209.85.216.48 mail-qa0-f48.google.com Received: from [209.85.216.48] ([209.85.216.48:62945] helo=mail-qa0-f48.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 78/85-33016-2298AE45 for ; Sun, 22 Feb 2015 20:57:55 -0500 Received: by mail-qa0-f48.google.com with SMTP id dc16so20201244qab.7 for ; Sun, 22 Feb 2015 17:57:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=rgG/qomggigU/CFQ+J3K1uNXVYYtxpMdGa37b8C9CIA=; b=bhyoI6Cq6Ot/zt+hFg/Nyn5h8zNfheudxxL5Vtj8onB4tdrLAcpDZRcT0SCIS7anMD zeZ3sRO1s1ycpNhfnv2QPUAriZc56oFOZBgpFKtYR4A0RByJQHbk6HMBdOA2Gaw/YEL1 xaAaHxfmc4usExwSvDqhGc/73k4v2pYljcZHOBKzzPZx0TGOkkaZFFNdvUvkH1VuqdgO Q2C9YqzePQOyPjvO5dPiqO1BzWT6Mc3Lsr0aOEA+0peqsImqJD3Ee5s/wHoTgPwncmWz II6rjEjEWxoGRKnAGxUFh/0i83RhYbot4qW17q9/JS+L++NnFClfIgFCYpBNo/mfGIA6 WDEw== X-Received: by 10.140.102.205 with SMTP id w71mr18936448qge.104.1424656671944; Sun, 22 Feb 2015 17:57:51 -0800 (PST) Received: from [192.168.1.109] ([24.138.231.2]) by mx.google.com with ESMTPSA id 63sm16576819qhw.30.2015.02.22.17.57.49 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 22 Feb 2015 17:57:50 -0800 (PST) Message-ID: <54EA891B.6030405@gmail.com> Date: Sun, 22 Feb 2015 21:57:47 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Stanislav Malyshev , Anthony Ferrara CC: Zeev Suraski , Jefferson Gonzalez , PHP internals References: <2e4694f9805ee81ea0b2c79eab06c2d6@mail.gmail.com> <54EA5EDA.8010605@gmail.com> <54EA6A99.5010609@gmail.com> <54EA7F15.9030606@gmail.com> In-Reply-To: <54EA7F15.9030606@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] JIT (was RE: [PHP-DEV] Coercive Scalar Type Hints RFC) From: jgmdev@gmail.com (Jefferson Gonzalez) On 02/22/2015 09:15 PM, Stanislav Malyshev wrote: > We were talking about the case where the argument was even, you must > have missed that part. If the argument is not even, indeed both models > would produce the same error, no difference there. The only difference > in your model vs. dynamic model so far is that you forced the developer > to do manual (int) instead of doing much smarter coercive check on > entrance of foo(). There's no performance improvement in that and > there's reliability decrease. > How is coercive much smarter? Basically what coercive would do is similar to what the intval(), floatval(), etc... set of functions do with some type checking on the mix to ensure a value matches some set of rules. How casting (int) could be such dangerous thing? Lets take for example this code: echo (int) "whats cooking!"; echo intval("whats cooking"); Both statements print 0, so how is casting unsafe???