Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:123353 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by qa.php.net (Postfix) with ESMTPS id 9DFFA1A009C for ; Sat, 18 May 2024 16:44:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1716050715; bh=fONCqscpL8NvhpXS1a3bSBbr24buVWizYoNLln02z4I=; h=In-Reply-To:References:Date:From:To:Subject:From; b=j/QQFgVCbRWsDJOiTyI22+HyUEiJbCHmJKM/n0W02rQZfMWL65Lxg69vDN4FneTcu 4w+LZZG+hOOsLSSoSlQO5J/355Lt9p/IriiJ4+5GLTWMB75jEmuLri9QDW+VT/sktM 2TmDdbsqBc8WN8acrcSQIAup/5FbWBLp0QqN/fRAgd+ifIGz4QmEuXrXeTbsUOut3L 7OJsnFgGwWF3StinUUgc/zHGNUhA7TznMFPf1PjUUllNHG7VUDQhk3cj5535/xS2Nk +x+Mi2xQHc2cbtTzgzLx3C0inNakVM8M5bDVXyUlPBtb8BwYyMEgqaM9mUNC1060QO MXaZIJBkwHGAA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 590A7180574 for ; Sat, 18 May 2024 16:45:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) X-Envelope-From: Received: from fout7-smtp.messagingengine.com (fout7-smtp.messagingengine.com [103.168.172.150]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sat, 18 May 2024 16:45:13 +0000 (UTC) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailfout.nyi.internal (Postfix) with ESMTP id 32AD7138027E for ; Sat, 18 May 2024 12:44:19 -0400 (EDT) Received: from imap50 ([10.202.2.100]) by compute1.internal (MEProxy); Sat, 18 May 2024 12:44:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= garfieldtech.com; h=cc:content-type:content-type:date:date:from :from:in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm1; t=1716050659; x= 1716137059; bh=tJ5PwSeT8vRojelraRekaYshXwLzXGoXxNw506LIE9Y=; b=D 2HLP7m9+sZ4Z4zucyI08dEhDLgaMX8TRVt/sDyEEnhusEKKVvvSHuJyP41YrZGuR q5DlDPDuiXooJO09/AJTKmCCNlyx48T4YCGTN8tuAswPzbkvcACR0ObMwVplqb/B KWZMDUHr6e2iqEUsu3g5GvfI8sP1CgpW+O/D5J6c+o2ycKHjdJ8qm2R1kYDwlgiM 84vUMcPt8Htp3D99qbCRBwKFatuas1jZItVXdn43y2RDgOKdUrB0FK+BmMd2snbp mFYU7l5hp6LCwmxbsDr9m6tOWtw1EUghOImx7udJKzIGHnRxjeg28fuTQtsfYXs+ /ySOqjQVrZSRjHI1yT2+Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1716050659; x=1716137059; bh=tJ5PwSeT8vRojelraRekaYshXwLz XGoXxNw506LIE9Y=; b=IaNrQr2Kv0vPWTNMe7g8BcHhOZO1+IP+jEmqlnH/AGuO RmgUkAt6V/34sVsBdXllqmvwhZzHIfGzw6KIEtSjOoI1RIT5T+AKuNyv32Dx+37q 1NlcVRJMRCy7qN1XJO+kvbvZAGPiu4NSIGlKghKeFtVASIO7f+lMKhANPVYKhley 3pgy20kPBPFEkqzie89ViV6SlEzfN/bTWlKhEbJRH86F/q23PmauJyz6VImJg+CY ZvvWY1xOzf67ZTLOrfqSq0OaHkWujoBF85pYpTbagdcjb80BFltaHkiVcGRva2k7 cVtWMdGTpfKM8YFSE+Ld6EnbXL0F/nvVHltqoSmSig== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvdehiedgkeehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgesthdtredtreertdenucfhrhhomhepfdfnrghr rhihucfirghrfhhivghlugdfuceolhgrrhhrhiesghgrrhhfihgvlhguthgvtghhrdgtoh hmqeenucggtffrrghtthgvrhhnpeeglefgkeduiedvvdetffeujefftdfhjeeiveehgfff keduveektddvledvvdfffeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh grihhlfhhrohhmpehlrghrrhihsehgrghrfhhivghlughtvggthhdrtghomh X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id C28BD1700096; Sat, 18 May 2024 12:44:18 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.11.0-alpha0-456-gcd147058c-fm-hotfix-20240509.001-g0aad06e4 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 Message-ID: <864f67fb-01a5-49a6-9f81-b54600046652@app.fastmail.com> In-Reply-To: <407efbd0-2d9c-4bcb-b795-0ee326728415@heigl.org> References: <407efbd0-2d9c-4bcb-b795-0ee326728415@heigl.org> Date: Sat, 18 May 2024 11:43:58 -0500 To: "php internals" Subject: Re: [PHP-DEV] [Discussion] "Internal" attribute and warning Content-Type: text/plain From: larry@garfieldtech.com ("Larry Garfield") On Sat, May 18, 2024, at 11:06 AM, Andreas Heigl wrote: > Hey all. > > Am 18.05.24 um 16:00 schrieb Robert Landers: >> Hello internals, >> >> I've been thinking about having an "internal" attribute that will emit >> a warning if called from outside it's left-most namespace. >> >> It might look something like this: >> >> namespace MyCompany\PackageA { >> #[\Internal] function doStuff() {} >> } *snip* I think an important question to answer here is what we want to have as our definition of "package". 1. Should the package be defined by the namespace? If so, anyone can put code into any namespace; it's not even hard to add to someone else's namespace. 2. Should the package be implicit, or explicit? If it's a namespace, is it auto-implicit or an "empty" package? 3. Should package be defined/implied by the file system, like many languages? Then we'd need a way to define/declare a package on the file system. (I have some thoughts there.) But that may run into performance issues, though they could be solved by opcache. This could also make it harder to inject code into someone else's namespace. (Whether that's good or bad is a matter of opinion.) The proposed attribute would be going with point 2, implicitly. That may be a useful approach, I don't know, but it's not something we should do "implicitly", lest it cause issues for us in the future. --Larry Garfield