Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:84575 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 5111 invoked from network); 11 Mar 2015 20:50:10 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Mar 2015 20:50:10 -0000 Authentication-Results: pb1.pair.com header.from=zeev@zend.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=zeev@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 209.85.212.182 as permitted sender) X-PHP-List-Original-Sender: zeev@zend.com X-Host-Fingerprint: 209.85.212.182 mail-wi0-f182.google.com Received: from [209.85.212.182] ([209.85.212.182:33472] helo=mail-wi0-f182.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 53/F0-32765-08AA0055 for ; Wed, 11 Mar 2015 15:50:09 -0500 Received: by widfb4 with SMTP id fb4so30313817wid.0 for ; Wed, 11 Mar 2015 13:50:05 -0700 (PDT) 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; bh=WSvZ3brpmwk9zTyKG2+srSTfth2SjZIHtMmKLsl0ut4=; b=f+7VRwDXtmFa/pdwXmjcqQXIRHuP9DLGuM/AfWSrTCS/dyOrkCKkhH3YxZK97ZWvcs wZK1SLkjKjdP4pqmELEV4Orod2IGrJ00QXyt5CUpRiUvYQEzeh/EEYipFL/3SIYIN09k 4PaN9ArzdGhByF9ih4dSeAPK6MIniNXSjSb+osziNC7Nia/3eyE6Ga7X6lchGruN839K xekbSWrC4GItOTd7/XHtVfm+G+/0TUT7lwHL/vEUuIhxzHVGiyCsGHN5uL6OKwRutZPe wQGB8M0mdMJuThgWFk1qL7iBPA7Za/3vA/CMM/KSA9rS7MRe+ZxIa4xCXJKFBH9ETR+w X4Ag== X-Gm-Message-State: ALoCoQnjZKdEf0ITb2DJ190ozICB1KCsazM5m+SZipGEifRDlKJtiOZHGmvCgfGSjXUeDJiXpzN7COae/UFkcdtl3ZAs5sWQQdKGxYIJFScQsOvmMyLZPLHAw2CTNmdaixu/BFVNCCQqMg1lmm3/tADYoMsKAUZ8PQ== X-Received: by 10.194.177.132 with SMTP id cq4mr77768877wjc.99.1426107005576; Wed, 11 Mar 2015 13:50:05 -0700 (PDT) References: <76c47c6fbd961958c10bc1a069377a34@mail.gmail.com> <2d48b241e682e59df6ab876b42663628@mail.gmail.com> In-Reply-To: MIME-Version: 1.0 X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQD1YWXqQx6MzBD1VX0WwX4EEwdHWAHgk7pSAio5GUwCu5r9pQKIIxRHnoNBK9A= Date: Wed, 11 Mar 2015 22:50:05 +0200 Message-ID: To: Derick Rethans Cc: internals@lists.php.net Content-Type: text/plain; charset=UTF-8 Subject: RE: [PHP-DEV] RE: [VOTE][RFC] Coercive Scalar Type Hints From: zeev@zend.com (Zeev Suraski) > -----Original Message----- > From: Derick Rethans [mailto:derick@php.net] > Sent: Wednesday, March 11, 2015 10:37 PM > To: Zeev Suraski > Cc: Anthony Ferrara; internals@lists.php.net > Subject: RE: [PHP-DEV] RE: [VOTE][RFC] Coercive Scalar Type Hints > > > You're right, sorry. Reverse it then: > > function bar(int $x) > > $foo = 1.0; > > bar($foo); // will definitely fail in strict mode > > And it should fail, as logically it is the same as: > > $foo = 1.901 - 0.709 - 0.192; > bar($foo); > > which is only 1, if you look at it with a small enough precision. I'm not sure what you're trying to say. The two pieces are indeed identical from all points of view - static analysis, how it would behave in strict type hinting, weak type hinting or coercive type hinting. Zeev