Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110973 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 24623 invoked from network); 13 Jul 2020 12:41:49 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 13 Jul 2020 12:41:49 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 6FCA71804C6 for ; Mon, 13 Jul 2020 04:33:57 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-lj1-f175.google.com (mail-lj1-f175.google.com [209.85.208.175]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 13 Jul 2020 04:33:56 -0700 (PDT) Received: by mail-lj1-f175.google.com with SMTP id s9so17233645ljm.11 for ; Mon, 13 Jul 2020 04:33:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=DS+Ux7CzoC+GsqERzcs0BvPBrtr0H8owePDUHkBVvT0=; b=Z/gvz7d3P6kl5r7BeRPL54PTEI3J/q4vSob2uHNfEGKbeMZ1ShPR+1wmVDf7LyTMIF XOQjroyb59utrQPEpMY6t13sb6RGWRZaWc2gZFzqsFhxI4ocDYwqmq4BR5k9euyK+JfD jniIPR+EM9dd1os13Mz/7PHLgWkFesI8Cn2IfoggKyTIPfqw5mLSeIv7K8ewF20DcLBZ qXdz0MYOieBwg+hAwQoc3q/m8+Ls5YKdaOk3ouDIApZS7Ov85t5uUxnI1+ULHaCdpmcr xJrWo1jcR5dTwqacpo8kffUcsAIMuT6brFKigkjROxPETW6V7i/yN2bg6GDHllBxIvqM F6jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=DS+Ux7CzoC+GsqERzcs0BvPBrtr0H8owePDUHkBVvT0=; b=VfphRxOW94B80xOppkBrcmV09yO/Z9igXpEMvxjIcrRWAW9uR51YoLVJIwAeoEBAtr 8rNuOKu8zC6h+nYvuq2ArfGqWAR4+7oosQZcQMB0cuuUiSweDVo53XuCGW7F32eh16ft wO/h25BVftdCoX45AUAoLQf12YkltvlCmi1lP9lyzZVTKvhsNrLjuAocwIs69GKjDDqZ 5Vv9sAk+uRg3iRZJEOBdIgB/h9xe4prISKcSKEyaSFhpiIo4835Q88f5w6CZx0ujhY0w T2xV7ekUyXtn9cIF+WAhkI4f+1j8q6j9jdGIEIYRiWAWdsG0xBc/D0US4YV7Vlum6HfU iX4w== X-Gm-Message-State: AOAM530RUU7XBZfbLG20CP0sZ6NAFfseg0+NGBFHp5k63xyZ3wBuB34c VSvXVCw+uGB6ftc2quGgoyGbhs0evqykFTj1tOk= X-Google-Smtp-Source: ABdhPJztu9vCO+QsjLmBIaF6fLxY1Miv6gnhujUnKPYaMov9+um1CaVOgMEVM37KAwKvfnziiwBNOMVLrjYT561kGqA= X-Received: by 2002:a2e:850f:: with SMTP id j15mr26192180lji.44.1594640034495; Mon, 13 Jul 2020 04:33:54 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 13 Jul 2020 14:33:41 +0300 Message-ID: To: =?UTF-8?Q?Micha=C5=82_Marcin_Brzuchalski?= Cc: Nikita Popov , PHP Internals List Content-Type: multipart/alternative; boundary="000000000000cd02c605aa5110e0" Subject: Re: [PHP-DEV] [RFC][DISCUSSION] Language Constructs Syntax Changes From: benas.molis.iml@gmail.com (Benas IML) --000000000000cd02c605aa5110e0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hey Micha=C5=82, Personally, I think instead of making `declare(strict_types=3D1);` to look more like a constant, we should make it look more like a function. Since it seems that the named parameters RFC is going to be accepted, I think allowing for alternative `declare(strict_types: 1);` syntax would make much more sense. Best regards, Benas On Mon, Jul 13, 2020, 2:08 PM Micha=C5=82 Marcin Brzuchalski < michal.brzuchalski@gmail.com> wrote: > Hi Nikita, > > pon., 13 lip 2020 o 12:41 Nikita Popov napisa=C5= =82(a): > > > On Sun, Jul 5, 2020 at 9:36 AM Micha=C5=82 Marcin Brzuchalski < > > michal.brzuchalski@gmail.com> wrote: > > > >> Hi internals, > >> > >> I realise we're tight to the deadline but from my calculations, > >> this RFC should fit with 2w discussion and 2w voting before feature > >> freeze. > >> > >> The proposal is to allow two statements to skip parentheses so they > don't > >> look like expressions. > >> This goes to `declare` and `__halt_compiler`. > >> Changes have already been implemented and respective PR's are linked t= o > >> the > >> RFC. > >> > >> You can find the RFC at > >> https://wiki.php.net/rfc/language-constructs-syntax-changes > >> > >> There is no BC break! > >> Proposed changes only allow certain constructs to be considered valid. > >> > > > > I don't think introducing alternative syntax for declare and > halt_compiler > > is a good idea. It introduces two ways to write the same thing, without > > much benefit I can see. > > > > Your stated goal is to make it clearer that these aren't functions, but > > language constructs. I'm not sure your change helps that much: While > > "__halt_compiler()" looks like a function call, "__halt_compiler" looks > > like a constant lookup. For the declare syntax, "declare(a =3D 1)" is > already > > illegal syntax for functions, even with the parentheses. > > > > I can agree with "__halt_compiler;" similar to constant lookup, which > indeed does not mate it more clear. > > Regarding the second syntax for "declare" what I wanted to achieve is > reduce the number of different syntaxes and we do have quite a few in PHP= . > I've noticed that the "declare" syntax is quite similar to the const > declare if you simply remove parentheses, > which therefore IMO increases readability, consider this example: > > declare strict_types =3D 1; > const GEAR_LIMIT =3D 5; > > From parser perspective, these both use const_list and only differ by a > first keyword and looks similar and present the same syntax construct. > Which currently is not true and they're both presented as a different > syntax. > > By introducing an alternative syntax I planned to deprecate the old as so= on > as we could potentially do that. > I believe it'd be hard until we have ticks directive. > > Cheers, > -- > Micha=C5=82 Marcin Brzuchalski > --000000000000cd02c605aa5110e0--