Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:128217 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 lists.php.net (Postfix) with ESMTPS id 0568D1A00BC for ; Thu, 24 Jul 2025 17:42:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1753378822; bh=iCxtRJWdFpxYiOu/NQdtgwj2Fm2XGCi0C+hBXVBFnZk=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=BJhu2Da+bomUgxBevV7Ltnhgzd9Twb0xq63fvkGWRpweo5IeWfEDpc5wpYllhSTLf FawnFCByhpJ4dJ2IPahT/TqFL4KIDoL/isOfa5lolR7KGCeNCgzCpvhuVqxMGCsEFm hPxbAumd6q+TKXCPDZ5rc6QCbTAz0MiI/7i2wGxidpG5vNm4UgPOVvGWF5l2/o7Dj8 LbufQAR9ahTs0dk1wlf6AIFZrkI16d+epxx8iSh0azal2IGPtbkCL/ol+a0h2eJeda 5xvPeg2/0Nnl9F1rl/rNtIYD7AD3A4elQ+Ca2wNEpxVvtk3njXrOyU6qlhZ6Jtsjed wvlKXXI0orAcA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 8E3DB18006C for ; Thu, 24 Jul 2025 17:40:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) 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, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) X-Envelope-From: Received: from mail-pg1-f169.google.com (mail-pg1-f169.google.com [209.85.215.169]) (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, 24 Jul 2025 17:40:21 +0000 (UTC) Received: by mail-pg1-f169.google.com with SMTP id 41be03b00d2f7-b321bd36a41so1232689a12.2 for ; Thu, 24 Jul 2025 10:42:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1753378925; x=1753983725; darn=lists.php.net; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=DvrYeyXeeibk8W+RoYuZeQ8OfN7GP0l2B00Ad4OZWv0=; b=V2lqQznr/+ICVfAuXPlFJvD+VZzP2h1pnzt9hhoxFC/JznoTuNdzGoyt5kUFTW6hyQ 6ZgE52zfDc/GFJwYnpBFODojoEBwBTpM82+tPNKRLaKAx6e6NZmrtzegdUJHcbZeiltF A8gnPpA0c/r/ZD9BVpPcGFN1QprVmIl/i9FXmmQh3yiy41xcqW5L9lY0TbD5QwFFrW0M 4D0Kv/WvIYA3mr6v3DyRpcD9t0H1Fyt2XFGiRTLftMpNNeBvQ4hTWO4voDtntl2ZVTNz SPjd57b8U8wepUIX6SpX+j+vxBJ5pVN4NGLqCY6QtL5do6T2alj8WRtjEDL+G+Yj7zyh kODA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753378925; x=1753983725; h=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=DvrYeyXeeibk8W+RoYuZeQ8OfN7GP0l2B00Ad4OZWv0=; b=c6zBBnIUB5zaEvHGVXRQUu8nr/wry0AE3YheAYKhOfI5Sg0nHyYYesGAo+muQDtVFU 0rDCsfacc2WM7TQCMpLFL7At2jxFU+KljLz8agaUGVLabMwVK5avwidatWszgMN4egO+ WiH16HGMlccdvBC8Cb+a6t5Vu+LRhihckIRgyTsaK9tEjvIYPSN8AzIee+DCh4dddGS8 Jf7v5dHA9XCGkYrUNc3D3l21WeB5QmbYnGd2QFYTMsJ60ki2Oj4uaUHktZEO9EZClcCv MuRjgrsJNMiFz3WwtSA5hDKpBtrW3WazfqUWwWC8zW/ICzwVv3GhVRRs8d7tu9LH2TaE 6nXA== X-Forwarded-Encrypted: i=1; AJvYcCWr6tPxz//c512HRNj4O3cvsZ+qRudOYHVqmDVyFhc6JYN8fMIenBqyupYz+9z38nUIhAN7Fypm3+I=@lists.php.net X-Gm-Message-State: AOJu0YwK3PK32ZkfUAExVc7h9pyxNthAbxh7ZyRul8BSYQGg2UDoRe43 5z0uUBahuGiZvu+PPLOpqgCAmM9VxR0l3mTkRnl1eCotf6YDl9wwLT0BUmf95QqlP469Qm9rw5n +WgSPR+j05A42x/6pDdvmpF+RjaS9x0U= X-Gm-Gg: ASbGnctUl3Hg2zlx94mb7EjTPdTCwwBCZniO2Iw0ZEI7PhqZuVKaD27cGi1KGF1ZktA 0Gz6/pNx+ECxudqIcCzbMQ1P8fxgW+Zi7Yk5GvmtxgNuIoBu8AaGlr4c60nI9q7zHbeS7HqeYdU QTSTMy033vKy897OF/LNvIdpdfA/x+LWxBadhJWyYp0m/ydXuXqpWr/y1GGcm60ur3VVi5B2lob 6A= X-Google-Smtp-Source: AGHT+IEqklsJs1njSwEjDRw5odqKdYI3xS6otb022YLcY8F56QuLngtnJN2o8fbHWlTF/TZuwrMcKlBG76afDO9qvRg= X-Received: by 2002:a17:90b:1dc7:b0:311:c939:c848 with SMTP id 98e67ed59e1d1-31e50626248mr13219167a91.0.1753378924655; Thu, 24 Jul 2025 10:42:04 -0700 (PDT) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 References: <1ecc1fd2-3837-4409-98c8-543b26de4955@app.fastmail.com> <2F7F0393-1E16-4040-AC5E-E3D878FA5A91@pmjones.io> In-Reply-To: <2F7F0393-1E16-4040-AC5E-E3D878FA5A91@pmjones.io> Date: Thu, 24 Jul 2025 20:41:53 +0300 X-Gm-Features: Ac12FXyUi-TA2byDFSyYugY9nKtTVHvNnEGiJ9pI9PGlcNFJSv-C5_Qj7DEOWzk Message-ID: Subject: Re: [PHP-DEV] Discussion Short Constructor To: "Paul M. Jones" Cc: Deleu , Larry Garfield , php internals Content-Type: multipart/alternative; boundary="000000000000f5f9b0063ab05787" From: xepozzd@gmail.com (Dmitry Derepko) --000000000000f5f9b0063ab05787 Content-Type: text/plain; charset="UTF-8" Good catch for multi-classes per file with such feature, but I think it's not the time to do it. As an alternative way to find the class is to look at the all files in the namespace: src/App/Controller/ ---- IndexController.php ---- BlogController.php IndexController.php contains ``` namespace App\Controller; class IndexController {} class IndexGetRequest {} class ItemGetRequest {} class ItemPostRequest {} ``` So lookup for \App\Controller\ItemGetRequest will look at src/App/Controller/*.php files, caching the rest of the classes found during the lookup. Or something like that. I think we should discuss the idea of the Short Constructor here. At least it does not require autoloading changes, but thanks for mentioning it. Btw, all possible changes of the autoloading may be proposed to Composer project without any RFC right now. -- Best regards, Dmitrii Derepko. @xepozz --000000000000f5f9b0063ab05787 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Good catch for multi-classes per file with such featu= re, but I think it's not the time to do it.

<= /div>
As an alternative way to find the class is to look at= the all files in the namespace:

src/App/Controller/
---- IndexController.php
---- BlogController.php

IndexController.php contains

```
namespace App\Controller;

class IndexCont= roller {}

class IndexGetRequest {}
class= ItemGetRequest {}
class ItemPostRequest {}
```

So lookup for \App\Controller\ItemGetRequest will look at= src/App/Controller/*.php files, caching the rest of the classes found duri= ng the lookup.
Or something like that.=C2=A0

=
I think we should discuss the idea of the Short Constructor here. At l= east it does not require autoloading changes, but thanks for mentioning it.=
Btw, all possible changes of the autoloading may be proposed to = Composer project without any RFC right now.=C2=A0

--
B= est regards,
Dmitrii Derepko.
--000000000000f5f9b0063ab05787--