Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:85194 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 32714 invoked from network); 18 Mar 2015 13:33:37 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Mar 2015 13:33:37 -0000 Authentication-Results: pb1.pair.com header.from=pajousek@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=pajousek@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.192.53 as permitted sender) X-PHP-List-Original-Sender: pajousek@gmail.com X-Host-Fingerprint: 209.85.192.53 mail-qg0-f53.google.com Received: from [209.85.192.53] ([209.85.192.53:33453] helo=mail-qg0-f53.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 80/10-32095-0BE79055 for ; Wed, 18 Mar 2015 08:33:37 -0500 Received: by qgfa8 with SMTP id a8so36395691qgf.0 for ; Wed, 18 Mar 2015 06:33:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=0CdG7DIyAy+CDtnmY+3ovDratNNp5VlshuFiqUUoyik=; b=BHsq87e1U9bXfv4N48nEaQi+iv8m0WVqXOX+3Uq5Ydru6gY5trVD76ie9HGF+PdGwh oXJ8S7AByd/k1nTb1C8XkcuDG6LieAMXaRJFwGpomAHzpXsZ6IFPw2F1AtbtrK337J5b U3BHM7kszfF9yoaRiFxtY4ko4jzZfMPgOCOaBFJSJnCIDOXD7DPwB8Uqy0kDDNvvI2K8 GbJ22jZTwJwlh+FzT/dCjRD4pktU7PYdBawA1C9vBl2IVDXu7FJ47dK9/vVvTcjRR+HS DIbhoRWIIJa2AfiMntXtXvZE/N7hCMTg5f9iqVaWXdPwYR+8ICAFNBbLJ3P2zFqyK9bY GGPQ== MIME-Version: 1.0 X-Received: by 10.140.239.150 with SMTP id k144mr92084169qhc.77.1426685614070; Wed, 18 Mar 2015 06:33:34 -0700 (PDT) Received: by 10.96.160.99 with HTTP; Wed, 18 Mar 2015 06:33:33 -0700 (PDT) In-Reply-To: <1c45330124cc799d5d057f604c11ec92.squirrel@webmail.klapt.com> References: <1c45330124cc799d5d057f604c11ec92.squirrel@webmail.klapt.com> Date: Wed, 18 Mar 2015 14:33:33 +0100 Message-ID: To: Anatol Belski Cc: Pierre Joye , PHP internals , Anthony Ferrara Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] [RFC][Accepted] Scalar Type Declarations V0.5 From: pajousek@gmail.com (=?UTF-8?Q?Pavel_Kou=C5=99il?=) On Wed, Mar 18, 2015 at 1:47 PM, Anatol Belski wrot= e: > Pavel, > > On Wed, March 18, 2015 11:05, Pavel Kou=C5=99il wrote: >> On Wed, Mar 18, 2015 at 11:01 AM, Pierre Joye >> wrote: >> >>> >>> On Mar 18, 2015 4:56 PM, "Pavel Kou=C5=99il" wrote= : >>> >>>> >>>> On Mon, Mar 16, 2015 at 10:03 PM, Anthony Ferrara >>>> >>>> wrote: >>>> >>>>> All, >>>>> >>>>> >>>>> Voting has been closed on the scalar type declarations v0.5 RFC: >>>>> >>>>> >>>>> https://wiki.php.net/rfc/scalar_type_hints_v5 >>>>> >>>>> >>>>> At a final score of 108:48, it has been accepted for PHP 7. >>>>> >>>>> >>>>> Thank you. >>>>> >>>>> >>>>> Anthony >>>>> >>>>> >>>>> -- >>>>> PHP Internals - PHP Runtime Development Mailing List >>>>> To unsubscribe, visit: http://www.php.net/unsub.php >>>>> >>>>> >>>> >>>> Hello, >>>> >>>> >>>> how will these examples work btw? >>>> >>>> // a.php >>>> >>> declare(strict_types=3D1); function foo($fn) { $fn("1"); >>>> }; >>>> >>>> >>>> // b.php >>>> >>> require 'a.php'; foo(function (int $a) { return $a * 2; }); >>>> >>>> >>>> >>>> // c.php >>>> >>> function foo($fn) { $fn("1"); >>>> }; >>>> >>>> >>>> // d.php >>>> >>> declare(strict_types=3D1); require 'c.php'; foo(function (int $a) { re= turn >>>> $a * 2; }); >>>> >>>> >>>> I can't find this in the RFC. I'd intuitively expect error in the >>>> first example and the second one to work OK. >>>> >>>> But at the same time, if there will be an error in the first example, >>>> it is IMHO a huge flaw with this RFC. :/ >>> >>> Git clone, compile, try, report. >>> >>> >>> It sounds pretty straight forward to me instead of asking the same >>> questions (in various form but it ends to the same answer). >>> >>> >>> And the patch should be applied sooner rather than later. So we can fix >>> bugs if there are actual ones in the current implementation. >> >> Hello, >> >> >> if I had time to set up the compilation of PHP on Windows, I'd do it - b= ut >> I don't. I wanted to try it myself via http://3v4l.org/, but it >> unfortunately doesn't support multiple files. >> > > for anyone needing to test on Windows, there was builds for an older RFC > version > > http://windows.php.net/downloads/snaps/ostc/scalar_type_hints_2_strict_mo= de/ > > but I just made quick builds for the current as well > > http://windows.php.net/downloads/snaps/ostc/scalar_type_hints_v5/ > > So you've got the choice. > > Cheers > > Anatol > Hello, I've tried the build, and it seems like it's in the strict mode 100% by default, and the "declare" statement doesn't recognize strict_types ("PHP Warning: Unsupported declare 'strict_types'"). Is this intentional? Regards Pavel Koruil