Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:119895 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 25710 invoked from network); 11 Apr 2023 03:08:59 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 11 Apr 2023 03:08:59 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 1613C1804D4 for ; Mon, 10 Apr 2023 20:08:58 -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=1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, SPF_SOFTFAIL,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-oi1-f177.google.com (mail-oi1-f177.google.com [209.85.167.177]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 10 Apr 2023 20:08:57 -0700 (PDT) Received: by mail-oi1-f177.google.com with SMTP id j12so4644478oij.3 for ; Mon, 10 Apr 2023 20:08:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=golemon-com.20210112.gappssmtp.com; s=20210112; t=1681182536; x=1683774536; h=to:in-reply-to:cc:references:message-id:date:subject:mime-version :from:content-transfer-encoding:from:to:cc:subject:date:message-id :reply-to; bh=oUQlGFt7siBdkcrYXTzzo+/+MIsX8YhnlrFWYa4d2sI=; b=6BqqYMowIfhiMTDzn5nAFdEHWhUP3yZuh3Txxzy4+O7TQ0yXQ7JCZ9a9S9bTvks0Lr KS4LmVcXtryYunBdQVbUharwVEhXfIACGqA6iYehUl1N3XEEwuP8UHwvt7hgPOJhIMxh h4gN53h/AWWJ1dLxR6p/tqgVnbFvAFbzSakfclNswwf/P2vqiSoOKZj9uyYPgO11bIpg I3dP/TYuYLU3k15dHxvZrE+PkP1k6BXbXwUctbyTtT+ZrOfantOQGrykrRzK3mMCERt5 MY6sEX8LvKERw7PHg7mDzslBXXEE03+pLqLIKFmuyk8yi9XQ60nKTO03VkrYYgp1Kw5b sVmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681182536; x=1683774536; h=to:in-reply-to:cc:references:message-id:date:subject:mime-version :from:content-transfer-encoding:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=oUQlGFt7siBdkcrYXTzzo+/+MIsX8YhnlrFWYa4d2sI=; b=2Q3tmvUyvisY+x4zYnIm17kockZEJ6Kysrv3Jvz45GlVlB1P6INww5ruGGEQq1//yh KcM0hoIi66T+XlSRlg/m7hK8DWgphreUraqk8SfIOtVINYVJWpq4hW25OuO78JqjeOXf FeF4Il4Hk5BQl/mUkxw+8q6HMI6HWk+DZ265tBtOQeLmWuOwx01mCKZ3eAbqVkDAzhR3 w9Nax1SvHT+RAJXXVbDatI/jj5aSQU0UT3AO7dlTyHiowd7d/iqV0YjyS5Vrqm4LYRRS dcGXpEt7EuR+iYlj4HLgRzhyssf7qTSE5b2mzi4Z0yw24U3lrcrOTXB+O1mF/p1cPIGC dfjw== X-Gm-Message-State: AAQBX9ce6/wkD/cH7usuGRRkAObyF8FYMbG+jjY+R7pME+22CHP7xTbI 4S/IIZNQOnXmDtWNp0VOcUa95oiVF0O5jarUYU8= X-Google-Smtp-Source: AKy350YTCrPhooe6lnRMC7wt+SAEwKu14IljAJgGuh0mt2Ncqw9ReATnvRojSDojDWdcCtf728qi7Q== X-Received: by 2002:aca:1a09:0:b0:38b:7fc3:cbf6 with SMTP id a9-20020aca1a09000000b0038b7fc3cbf6mr3781789oia.19.1681182536427; Mon, 10 Apr 2023 20:08:56 -0700 (PDT) Received: from smtpclient.apple (23-120-123-116.lightspeed.cicril.sbcglobal.net. [23.120.123.116]) by smtp.gmail.com with ESMTPSA id bj22-20020a056808199600b0038733b00a5fsm5088404oib.10.2023.04.10.20.08.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 10 Apr 2023 20:08:55 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (1.0) Date: Mon, 10 Apr 2023 22:08:44 -0500 Message-ID: References: Cc: PHP internals In-Reply-To: To: Michael Morris X-Mailer: iPhone Mail (20E247) Subject: Re: [PHP-DEV] PHP Modules From: php@golemon.com (Sara Golemon) > On Apr 10, 2023, at 20:40, Michael Morris wrote: >=20 > =EF=BB=BFThis will be long. Yes, it's long, so I'm going to focus on a couple things and not quote too m= uch. > I propose PHP Modules to hold new features. What you seem to have described is improved lexical scoping. Rather than a s= hared "global" scope for classes, functions, constants, and variables, you'd= like to allow files, or perhaps even statement lists (open brace to closed b= race) to work as either independent or compositional scopes. Basically, mak= e scopes in a certain mode of PHP act more like Javascript. I'll be honest, if we could throw away PHP's old behavior and make this the o= nly mode, I'd be pretty happy. We can't of course, at best we'd have to mix= (and yes, I know that's part of your suggestion). This is a LOT of complexity. Not impossible, nothing is, but I'm fairly confident it would make maintaini= ng the runtime harder, and would notably slow execution. Not saying "no", s= ince I lack that power, but I do want to make it clear how HARD this feature= would be to implement well. > PHP Modules also would not > parse as templates at all - no opening that will be a headache for IDE makers, but it's not insurmountable). I would suggest, as a compromise, keep the initial open tag (or maybe an alt= ernative one, like I hope this helps, or at least spurs a conversation to come up with > something to address this issue. Lastly, like the stability thread, this isn't a new suggestion, and I'd reco= mmend googling back through the archives for prior discussions. Past failur= es don't mean it won't work today... Opinions change and so does the runtime= , but it may be helpful to understand the complexities presented by this str= ategy, and what the objections to it will likely boil down to. See also "PHP Editions" which is a different, but closely related proposal p= ut forth by Andi as recently as the 7.x era. -Sara=