Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:126730 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 4717C1A00BC for ; Thu, 13 Mar 2025 11:41:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1741865964; bh=hL/GZG0EzkzvUuo3h719n55c3ww30YD3EtdZ7PQQvZA=; h=References:In-Reply-To:From:Date:Subject:To:From; b=Y8M9FQzdrvgQXh1DQ62Ec0Get5Cz4KGuO/kYbp+kozwiPDp5W6h1ByQeKqaqWbANm NLYS7kQ1AM0VcsKNyXacoB7lMHotDvK7P0rEMuZuBg71bsadVC72pc1VkrjZA9CVcR 8MI+TIkHbOWM44M8mnD3cmmU2+4wr3jZVJmpMquiHcigyv5QOd2ZfeJE/Ep+lMSEmL A4xtBmnGzrNdrV3pGLlsDdy9Ntx/Wh3pppnevR1RYcNmwiBO6jbnwcxTHhRdMg5TD2 NB9Ne6fxmIwFongiWAook7IS1Um9qMzyHoPq5Lz35uB2ZkWoKv2L4zAJmeIQ29c0qq dXKnluzPH21Ng== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id EA798180050 for ; Thu, 13 Mar 2025 11:39:23 +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=-2.0 required=5.0 tests=BAYES_40,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 autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-qv1-f46.google.com (mail-qv1-f46.google.com [209.85.219.46]) (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 ; Thu, 13 Mar 2025 11:39:23 +0000 (UTC) Received: by mail-qv1-f46.google.com with SMTP id 6a1803df08f44-6e89a2501a0so8936696d6.1 for ; Thu, 13 Mar 2025 04:41:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1741866116; x=1742470916; darn=lists.php.net; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=hL/GZG0EzkzvUuo3h719n55c3ww30YD3EtdZ7PQQvZA=; b=FpihyydId6gnsWfb/OgKyEI8MzfA8CE1qQVTOtjJOXrHp6uvaWcIfwN1PHBfvh3sqD geP4ZUrSO7ULNmA5lVvj9lhmkKgnEiNWq1ZBkud22svqS7uw5s4reuUjIiQIZ/5gwFTA FF9Gb1Yix8leFfw+OLCrg/QDyR09ISxmekCFWwWwDCaI5edPIIHAH+BtVCWGJm0U+ZL+ UkZRIwcwZ5MDg7us+yMoCR81J39A8KP1gRGSXkKubzriD9UhpNzKR2N2mEQk0QbF1eVY mzSzlkAUdbEGtE06xcrzPyev/6gkJYwdU/gpV8i+3VCbZF9RPokl/b7q6mJtzXg46vh1 UH7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741866116; x=1742470916; h=content-transfer-encoding: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=hL/GZG0EzkzvUuo3h719n55c3ww30YD3EtdZ7PQQvZA=; b=ZRLix59qUcvyilY3It+f9qQ/rwaPj1sgIng02E/hzsO9/AbQSjisB17V5cmJOroSPu IKfGQI02J7RF8h7ezllmB0DNjZN0eR59+/jZ3r5+OWealdq3Xo7gOlGvPUrYAEKTOSyI ivl/C1jXeqicjHYGAouQ1CGT8wq9n8fpKaVQt5MA3A9kwlE6LtHH637iF2liLr/gv0o7 uhjXiSZxeHpjYPsEt1dn5ri5H9dBetd1hHsTAw/Zk9kSoGByq7JEu4OT2tYnmEtA3Q0I D+NmnicIDgGJBq036Gt0gLGut51D5ujWmewkKNoCQoHH1+Qa8F3xHQiU3rR4TTSkcsS9 Y1Rw== X-Gm-Message-State: AOJu0YxGj5a77LzcyHXG3THZmfHGWtSPbL8MHwHWhA/CWr1X68CbPrrC VaE5+z1btyAJTw2Cp0EfYQrlvp3ncrpzqB4zkuROt9Tv+kehjfDL/coI+YM8LEYPkbxKcVS9BEs Dk5cH+bRzfvv3BYkzjwHcJbyxWeSe2tXjOBo= X-Gm-Gg: ASbGnctz+7+6xDkYvDo+QT1JXowT0dkefYoKwcIiFB3iwvCCn2bp1LqRq0Myf6x+RcC WA/cgq5M3JWjJKxB14pG4lIYaCXwbYFCpfMtny51LA0DdW+5LOiT/MH5gWzggyGe3ujtyvQitfr 3Sd3A8EUk0rieB/kWIMc42pRKg3fcPFIO/nCk1xz9pj4B6sGBhbef0VhBrq84= X-Google-Smtp-Source: AGHT+IEfNd9yZvgkXVorglEDW5LOzxAGzuiYkTlTpylpg1Yl04yf5v4MHR5QFSI+bbU0KK0zc7gKcUH8iCksGOvxNag= X-Received: by 2002:a05:6214:76c:b0:6e8:fc05:aa23 with SMTP id 6a1803df08f44-6e9005bc4cfmr379483846d6.3.1741866116147; Thu, 13 Mar 2025 04:41:56 -0700 (PDT) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 References: <2935d0e2-ddc4-447c-ab37-c9b7337b8b60@app.fastmail.com> <0d94bf183543ee9948fcd31337198438@bastelstu.be> In-Reply-To: <0d94bf183543ee9948fcd31337198438@bastelstu.be> Date: Thu, 13 Mar 2025 12:41:50 +0100 X-Gm-Features: AQ5f1JpxUsx4IgoMnAGbMiXNVgm_afgZSwcP5jcOvZGJWGaceJDsVG-RfcOd7oc Message-ID: Subject: Re: [PHP-DEV] Re: RFC: short and inner classes To: PHP internals Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable From: tovilo.ilija@gmail.com (Ilija Tovilo) Hi Rob On Thu, Mar 13, 2025 at 12:01=E2=80=AFPM Tim D=C3=BCsterhus wrote: > > Am 2025-03-12 11:10, schrieb Rob Landers: > > - Accessing inner classes is done via a new token: ":>" instead of > > "::". > > I don't particularly like that. It is =E2=80=9Cinvented syntax=E2=80=9D a= nd I don't > think that inner classes are sufficiently valuable to dedicate an entire > operator to them I would like to echo these thoughts. I also think the RFC is kind of missing the mark. Arguably the most common use-case for `@internal` is to restrict a class to a specific package/module or namespace, regardless of the user's class hierarchy. I believe you specifically call this a non-goal: > Currently, many libraries implement =E2=80=9Cinternal=E2=80=9D classes by= using a naming convention or an @internal annotation in the docblock. Inne= r classes enable libraries to define an internal class that cannot be used = outside the class it is defined inside. This feature is not meant to be use= d as a =E2=80=9Cmodule=E2=80=9D system, but rather as a way to encapsulate = logic internal to a class, such as DTOs or helper classes. At least if I understand this statement correctly. In that case, I see much less value in nested classes. They might still be ok if they are extremely simple, but the proposal is currently quite complex. It has a custom operator, it deals with shadowing, LSP, runtime resolution and more, in addition to visibility which is the actual goal. Maybe more use-cases are enabled, but I don't think they are currently well described. Assuming visibility can partially be implemented in a simpler way (e.g. top-level, file-private classes), the costs seem to outweigh the benefits in my opinion. Hence I would not be in favor of the RFC in this or a similar form. Ilija