Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110972 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 19720 invoked from network); 13 Jul 2020 12:16:25 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 13 Jul 2020 12:16:25 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 8601A1804DB for ; Mon, 13 Jul 2020 04:08:32 -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_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-oo1-f44.google.com (mail-oo1-f44.google.com [209.85.161.44]) (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:08:31 -0700 (PDT) Received: by mail-oo1-f44.google.com with SMTP id t6so2265938ooh.4 for ; Mon, 13 Jul 2020 04:08:31 -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=q4U6o98MBMbpJNg8mHHIEZ8ZvPh70V4H6m9GOQANnLU=; b=R9cIbq2OBXFn7IGrHkGD+AAg3MMNgXsAV+1snV1M2xnXgJI8TiNygTNogx5+w5LKRZ HgNFDsn9ziS/Hl6UJ71RLqYWYDn1XOyfa4+VFbhAIGhPpYGwJhU4IViKGjIJxckenfhs SBy2icjuqut1nQRj9zrO+52woeQHJfc46UuNSMOhUaYEIK4ML5LiD1K9s6RX/qPER5Yx qyJDRd+s6N1r5+qFH4M6Od5rjJ+6X7qMQS2vGruiZOot9dLUedcD2Wgb4Lq60MA5akgt lke3S5zq32U6k39UqpynGEJQJuZt11xXagpCbIFJony9nsEcl4k9FyPNl+uUCvoYpwqW Jasg== 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=q4U6o98MBMbpJNg8mHHIEZ8ZvPh70V4H6m9GOQANnLU=; b=Jz+xfSFTC8hwL+IdZBCvLNddPpLqMxRtXtQluU1cVt1I0OC1pga0KxxKtDwDdhkEpf 5HmOCZJwfh1LTLHLyJ/cQi13VoH1v4CcWUFm2TU5HcH6mSqarDAjPGD6wTK1dy1Ftahe U5q1safiP8NJ1/UctK+EzqTBEmb4gu6oGpY2lXZ4/EokMJeI3VsLVeu6EiYxLXXBEhxx 9xxKuSie1Zq8hwjHxu7voS4n80no7jt4gPW/s96PNELbqdk5HurcCcj+U7W+6ypP5Ngl hGgVfjjpfttp3lbkv6mlfoJnFuZdxMAL6hkjgYTFwzM0LvwRyVnrxta4dbyG2S1IhiPY XP+A== X-Gm-Message-State: AOAM5318GvnnQApZpMwz0NeBrNt4igeQ+m/6U9QTo0vUEkVZRxsVHJiO tL05fV21a0lqKABkzUn8ndWAYfYGDDUnavnZDsA= X-Google-Smtp-Source: ABdhPJwA+uyCKfQy1zxJXT2laiFU0eGTLLmEmIQTrRBILYHhUs/LHqwQy8nVyH5bQwRAXEDfp/uykgv8MDehtip+UjQ= X-Received: by 2002:a4a:1d83:: with SMTP id 125mr70641998oog.18.1594638508119; Mon, 13 Jul 2020 04:08:28 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 13 Jul 2020 13:08:16 +0200 Message-ID: To: Nikita Popov Cc: PHP Internals List Content-Type: multipart/alternative; boundary="000000000000d25b6805aa50b580" Subject: Re: [PHP-DEV] [RFC][DISCUSSION] Language Constructs Syntax Changes From: michal.brzuchalski@gmail.com (=?UTF-8?Q?Micha=C5=82_Marcin_Brzuchalski?=) --000000000000d25b6805aa50b580 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 to >> 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_compile= r > 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 alr= eady > 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 soon as we could potentially do that. I believe it'd be hard until we have ticks directive. Cheers, -- Micha=C5=82 Marcin Brzuchalski --000000000000d25b6805aa50b580--