Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:123372 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 ADB661A009C for ; Mon, 20 May 2024 17:25:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1716225974; bh=KJ4u+xG4m72AMyf1AQil9XQ5CAEncaVG3fwRbWWe3kc=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=gdP87gRSUsGfQasFxexB7wIFhmChysdBn5vxMadxKkxF6SWglTJ1EItmIFeEly1+Y B51dl/Bg+919cCbs0q52O/jI01eJlRUVbN1UY/UuPfQT2SM4UpQClcszUSUWh66fjc kA6sqhNlnptGjLeNWI09Owd/s4uQ/jbMxmkvNKIj35qMx2xvQ3SRsEG0+v4VwVCqvT jVRYrkPnRCpF8dgu8r1euGD3J53sXL2Wp0F/RH5ot+LjfOrQTk1F6Au3sEQ90Njs/2 de2fiTFL3byQSd1E/yc2Kat3U22/VEap9cL4+uz5TKRoGMKETvy24MnLi9KWCUy/5v sq4YuxCXmsEXA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 1B94C18006D for ; Mon, 20 May 2024 17:26: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.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, 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 mail-lf1-f48.google.com (mail-lf1-f48.google.com [209.85.167.48]) (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 ; Mon, 20 May 2024 17:26:13 +0000 (UTC) Received: by mail-lf1-f48.google.com with SMTP id 2adb3069b0e04-51f45104ef0so3929611e87.3 for ; Mon, 20 May 2024 10:25:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716225917; x=1716830717; darn=lists.php.net; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=nETHdSOGrRzhXHtgIuO0f0Dyvc7rA7JgZwU+t98vsMY=; b=OygTHSOShRXMMfj0qGAiLJ2TbxbzgeoHb8g3mE0R8UnhVxfo/1cSxC8FNyo3G1ME7n R2CgD/7h9GrOKO72s/LwG1VUyiyuGFnjk5SGRsDdPR4A3y8/9cH8Y52xS5P+98/tg1Q+ 3pYzWJ1qkhKfrxhP5Mdc7TRxdvKBAeRfbXxZuCNYVE85yuf/Cucr3xHB8Iuflh38X5rx s54qWZrTDOSTh7TO11sDSShXBeBsbyCZmkOBuXTD3/vlMde5wzhwioWnTfzZMy//koJc /j36KXFhd5AaN/acOJVGe6H8J7vkVhO4lMpLcfidjdUCAytDG8tPlIUYBSqL2Cags8s7 JmCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716225917; x=1716830717; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nETHdSOGrRzhXHtgIuO0f0Dyvc7rA7JgZwU+t98vsMY=; b=RdB3f9VUZhUe92o32qHjXH3h0Z2jU9H36jWYeqjn37Wo3EsM5Kd5xvCSCa0as691Ml pQWrDA27OZzwwDG8KHYUe5N4219Fy4uVrySaDAwO0cdTPN0eOwdtbhxsWkUo7S1Csefw t8DZqnBKmvFs3Gkp3qpTgnXUhmq80wMUXHS8BCsGM5q+2UW1H/5GF0LMoOmi90ahiT8K BV+i01xLV4/sqxZYPl6o8BhIjxkkUl7GfbzKF0YduX8VbsWI7mrC0jg9oAN3BfVLAtxs SnTMIwJOj2b7vnTPJOsvEAXJ789YyiXl2YmW7D88HEu0d1GKGbrkSYJKU2o9K0h02c1K dOZw== X-Gm-Message-State: AOJu0YxfbsqCLmxnXnqUPsbTdlfFhpj22fFXDviCe5Q0pvVxYGHRa+Pr OxT0yogDN4lNaCQm5ocHPzvYQ5MGFHAin3w+isYUv3cVSVrf/7ZYk7n9+zI070UaX25OZ0bURUY f0xYrV2FA8Lk/H3AGg148X1ngKxkAX7R2CZI= X-Google-Smtp-Source: AGHT+IHLzxdIg9UC/UzbxyA+Gj7awWY2tIvjLeX9J3zeLtUCOGqRMQzLne4iJDQE2c1zf/tGfQpkEyJ1eZfkzIKJYco= X-Received: by 2002:a05:6512:398a:b0:519:2a88:add6 with SMTP id 2adb3069b0e04-5220fe7999amr22171833e87.55.1716225916434; Mon, 20 May 2024 10:25:16 -0700 (PDT) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 References: <407efbd0-2d9c-4bcb-b795-0ee326728415@heigl.org> <864f67fb-01a5-49a6-9f81-b54600046652@app.fastmail.com> In-Reply-To: Date: Mon, 20 May 2024 19:25:04 +0200 Message-ID: Subject: Re: [PHP-DEV] [Discussion] "Internal" attribute and warning To: Larry Garfield Cc: php internals Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable From: landers.robert@gmail.com (Robert Landers) On Mon, May 20, 2024 at 6:58=E2=80=AFPM Larry Garfield wrote: > > On Sat, May 18, 2024, at 6:15 PM, Robert Landers wrote: > > >> I think an important question to answer here is what we want to have a= s our definition of "package". > >> > >> 1. Should the package be defined by the namespace? If so, anyone can p= ut code into any namespace; it's not even hard to add to someone else's nam= espace. > >> 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 lan= guages? Then we'd need a way to define/declare a package on the file syste= m. (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 t= o inject code into someone else's namespace. (Whether that's good or bad i= s 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 > > > > Oof, I wasn't trying to open the "what is a package" can of worms, > > though that may need to happen sooner-or-later. I was mainly trying to > > be able to mark malleable APIs and set a conservative delimiter > > (top-level/root namespace) for the warning. I think being able to > > specify a more local delimiter (working on teams in large codebases) > > might also be useful. > Hey Larry, > Understandable, but "easy simple solutions" have a tendency to get in the= way of more complete solutions later, or at least cause confusion. So cons= idering the broader scope is important. Like, what happens in the future i= f we have both package visibility (whatever that means) and an #[Internal] = marker attribute (with whatever details)? What happens if the attribute's = namespace doesn't line up with a package? Which one should we use when, or= at that point do we call #[Internal] soft-deprecated? I think this is something of a moot point. PHP has been around for 30ish years or so. If nobody has championed packages by now ... I don't think holding back useful features until someone does is a worthwhile exercise. If we don't like it, we have several options: 0. I'm not necessarily going to work on this now ... and it probably wouldn't happen until this fall (well after the 8.4 cut off). So, there's plenty of time to convince me this is a terrible idea. 1. vote "no" before it ever gets past the RFC stage 2. create a competing RFC 3. create an RFC to deprecate/change the functionality afterwards 4. don't use it Anyway, there are currently only namespaces for organization in PHP. Any package system would almost certainly use them, so I'm not too worried about it. > > I don't have answers to those, but we would want answers before we added = the attribute. > > > PS pro-tip: use reply-to-all to email the original author of the email > > as well. I saw this email almost two hours ago on another email > > address I'm subscribed with but couldn't reply until now. If you also > > email the original author, we can communicate faster (for whatever > > that is worth) while the list plays catch-up. > > PS: I absolutely despise it when people use reply-all, and I get two copi= es of the email in 2 different folders that I have to clean up manually, an= d if I reply to the wrong one it breaks threading because I'm then replying= to a non-list email but sending it to the list. This is the only list I'm= on that has always had that problem. If people need to communicate faster= than email speeds, that's what the dozen available chat media are for. > > --Larry Garfield Robert Landers Software Engineer Utrecht NL