Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:107274 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 65303 invoked from network); 21 Sep 2019 12:17:57 -0000 Received: from unknown (HELO php-smtp3.php.net) (208.43.231.12) by pb1.pair.com with SMTP; 21 Sep 2019 12:17:57 -0000 Received: from php-smtp3.php.net (localhost [127.0.0.1]) by php-smtp3.php.net (Postfix) with ESMTP id E52442D2021 for ; Sat, 21 Sep 2019 02:56:03 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp3.php.net X-Spam-Level: X-Spam-Status: No, score=0.7 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS3215 2.6.0.0/16 X-Spam-Virus: No Received: from mail-ot1-x329.google.com (mail-ot1-x329.google.com [IPv6:2607:f8b0:4864:20::329]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp3.php.net (Postfix) with ESMTPS for ; Sat, 21 Sep 2019 02:56:03 -0700 (PDT) Received: by mail-ot1-x329.google.com with SMTP id e11so8268319otl.5 for ; Sat, 21 Sep 2019 02:56:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=Rm0EA2MVevtXJua0tSxSEi94XV1r0rzuV4thWIazCOs=; b=ujx2m41/aHQ499KVONq+DVIEqsfiZ0p/Nqd9tZQymkV2PcI2+sr3wVuSZKiItJNdxw i6AuuahliLHTq0e8GTuAxVXVXxA4NA4fN96EPU3sZ6MWRMDalbqtKtcrrmNFeb4J0WO1 DK6vuHDpfNFCJ3/SR+H1T7NkFpwnGE/ZUxsuYyDPIZbVM5dv6vGoau48I81YDqZ5ZTsq qJodME3dV/G/1WmD1cQe7BMX1U4PpwB6Eh+4IbfP+HINO2K6JXoEhwSmFbtmh335ptSS ET0tRzCZJlmQKd7oBo050CfwgOql5TCAB2WxKWq7zLwlmuBxFzWeBfvNzM5SEoWd7ssG IGAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=Rm0EA2MVevtXJua0tSxSEi94XV1r0rzuV4thWIazCOs=; b=f+Jlst/ybaxQSZU7liiKyn6jNPuyFxfCoHY7uWEevQkDZEaCIBJRvdQ3nxJjCVVfGG AkkRILtwfbbCtGfl6H+yer5WGY+g9XRURQbQxnJs+qprvH73iwyJfNSehDFIa4cRBy98 Hgt22vwW788ueoltwkq/zSqx71YTIzy5HQTCB2OKKWwcyN5XOSmAYIFs2cFkXT/4Vmf5 8CNaMWL+ifSlnUti2FV4F054u+sdmvhYPDGJqyyFgw3FQW2OxH0dxEYU/76vtH0tutTB 5gFNXlAjBtn9Vh36UeBxHy0ukvuZ7ELYaIkPjtkuVFvN3dE9qt5aWqLNhHeHANBBc6Wi 0SlA== X-Gm-Message-State: APjAAAU+VesyWcILxCOQ0OLuuB/7KDUb91Dmwomkje0LPnyxpXBiI9zw yBRkgkm5cPiqiNW4a6Yk4Lpew4Id+Dz9OBNfp2GULAmR X-Google-Smtp-Source: APXvYqxI/QyZvlv9JyuTlEDWVQSbQ/dWgqQcxfrVSEV1PDhEKN3HlSgIpu/EfYrlsLqWrioOvntPIyfpT1y8zdYHmVQ= X-Received: by 2002:a9d:3a5:: with SMTP id f34mr15339401otf.4.1569059762201; Sat, 21 Sep 2019 02:56:02 -0700 (PDT) MIME-Version: 1.0 Date: Sat, 21 Sep 2019 16:55:50 +0700 Message-ID: To: PHP internals Content-Type: multipart/alternative; boundary="000000000000c1eae205930d3141" X-Envelope-From: Subject: Question about `global` variable declaration From: webdevxp.com@gmail.com (Kosit Supanyo) --000000000000c1eae205930d3141 Content-Type: text/plain; charset="UTF-8" Hi Internals I'm working on my new proposals and I've found weirdness of global variable declaration in zend_language_parser.y. global_var: simple_variable { $$ = zend_ast_create(ZEND_AST_GLOBAL, zend_ast_create(ZEND_AST_VAR, $1)); } ; Above grammer allows something like this... global $$x; global $$$y; global $$$$z; global ${'abc'}; global $$$$$$$$$${random_int(0, PHP_INT_MAX)}; What's the propose of allowing this? And is there anyone out there knowing and using it? If not, should this be changed to allow only T_VARIABLE to make it consistent with `static` variable declaration? Regards --000000000000c1eae205930d3141--