Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:124209 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 B5D4C1A009C for ; Thu, 4 Jul 2024 01:00:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1720054902; bh=x2FR9TOeD/JBQCESEKrEwiXxn/JWZx2C6/IeLN13yUo=; h=From:Subject:Date:In-Reply-To:Cc:To:References:From; b=JX1fP3gksy1l4hKdZZtDIiQUiYhOpX/SGwXVxjjcLK9o4zUWufG/gFGUmxorOpuDy 9+AaDEy54g2GJPfqNMeeS6nkdZWM03pU1tBc4HIStxiUrEZyYnWRoG2rEaeR4VOx3A K60tFAVQz8CzGfqjhPH32x812LKhkI2pNhmaWx8LgRS2oK4Z5LF71WOJ4+xRjvIBXE nki7MUIb9UQmunQFqFV/ICg23SFHgViEHEQf9wmXHsljcLhDSybe2L3KuLPRvrwvrO ruPHdmbYjvlT4+I63IVLHXiIDl+3s2Hb1pZZJfBHYmoEg1cDbG/IzcbQ034AducKty Z5p4O3F0SFmZg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id A115E18007E for ; Thu, 4 Jul 2024 01:01:41 +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.8 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DMARC_MISSING,HTML_MESSAGE,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,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 mail-yw1-f182.google.com (mail-yw1-f182.google.com [209.85.128.182]) (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, 4 Jul 2024 01:01:41 +0000 (UTC) Received: by mail-yw1-f182.google.com with SMTP id 00721157ae682-63036fa87dbso893387b3.1 for ; Wed, 03 Jul 2024 18:00:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=newclarity-net.20230601.gappssmtp.com; s=20230601; t=1720054818; x=1720659618; darn=lists.php.net; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:from:to:cc:subject:date:message-id:reply-to; bh=UyZnLjcDOXewmbNzP2eRFHkuXwxWWGQgLu6GgPA0b6A=; b=IiC6Xr0+zFa/uBuCAnaDu6gcHVDRMkMkJ1yyDHyec19/ijTeHJEf408wH4epjXbmdc nrqxzLSoS79UPGUm/ykSRJ1Bx0IX+HYfynucu8SoeNkin3T51HEUVPvRCQNDm7NWRn7Z TRqQI9V3IJ8sVoI+xhq/pau4Oe/KlrBNTpd+FNGruykN1l9dKzY0ssvv0w1YvlmHZlHK ykDjFAZl2Heo2iCb+lhb4a5RnVpta4mHwanY1TzqB6HzBdLK4cvmQyORMHGO7tJDWrVy KslbneZYm7lBYmhXth0TGgGRVCCUDh0zALPos8Q+Z+i4gCJo+HUlyItyvGoqES0uxNW8 v2kQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720054818; x=1720659618; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=UyZnLjcDOXewmbNzP2eRFHkuXwxWWGQgLu6GgPA0b6A=; b=ogTrNcCgrV2XWcBWPuzDNXmVeyK3MqMp7pam0ujvpUiSHJcLyyJHLMKu5PezbrtXyF Nuj7PFlFqM2bq6+iQK9uITuhGaFiHqaUSzeI4OLvbD2dhuHg5RqkNfIpFJR4q7Q0X5u2 i5rI3coZkwiGD2CDOn1/uUGDM74PVT5RgQUrrUBZofOPTpnMoDqgLK8h0YcsUJXO3sSf qAnUQy85ztJ3rJ4Nt/r5SyERSvoTKWmJY918WmLLdVHFfKW8xGGw7sAG+tSqzrMC6Wnz 8vtMZO/KJ6twMg8XvcxM2eGm7SM6TUbu4yKd8a0HCrz00x3jrvY9gsF6bB7ptfcjDTgb dP2Q== X-Gm-Message-State: AOJu0YxLXibxghiS6n9VykMj617r8l9t4gDNycVk8+kt0xAgnN3CFmNp zzAww0il1G44HfZwsDcvZJ7SJQ2cGmA6BI4Q+xeFLB+HQ/bDA75HTqRr8Hpkwh0c6x/mm4uaMwv EwZ4= X-Google-Smtp-Source: AGHT+IHKr7NuESFKB/TNgsCMlDtokqsnSF8UoE2JshugL77bkJqRO1HuiNQwumGiLuCSBlHfdJEtNg== X-Received: by 2002:a81:430b:0:b0:62c:f782:ee1e with SMTP id 00721157ae682-652d63da8f6mr1062167b3.11.1720054818321; Wed, 03 Jul 2024 18:00:18 -0700 (PDT) Received: from smtpclient.apple (c-98-252-216-111.hsd1.ga.comcast.net. [98.252.216.111]) by smtp.gmail.com with ESMTPSA id 00721157ae682-651c50a7d91sm3345167b3.35.2024.07.03.18.00.16 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Jul 2024 18:00:17 -0700 (PDT) Message-ID: <4E3986CC-0848-4D53-9075-151E90C9C8E3@newclarity.net> Content-Type: multipart/alternative; boundary="Apple-Mail=_0F114384-008B-4BD6-8561-C649689B2CEA" Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.8\)) Subject: Re: [PHP-DEV] Iteration III: Packages (was Re: [PHP-DEV] [Initial Feedback] PHP User Modules - An Adaptation of ES6 from JavaScript) Date: Wed, 3 Jul 2024 21:00:15 -0400 In-Reply-To: Cc: PHP internals To: Michael Morris References: <09559430-4477-4516-8D78-6F4071E1AA6C@newclarity.net> <0182F3D6-F464-477F-9029-A2D0A8B50C71@koalephant.com> <86A83E30-00CE-434F-B316-EB9A55F92BDD@newclarity.net> X-Mailer: Apple Mail (2.3696.120.41.1.8) From: mike@newclarity.net (Mike Schinkel) --Apple-Mail=_0F114384-008B-4BD6-8561-C649689B2CEA Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Jul 3, 2024, at 8:24 PM, Michael Morris wrote: > On Wed, Jul 3, 2024 at 7:52=E2=80=AFPM Mike Schinkel = > wrote: > Me personally, the opinions that I do not like are the one-symbol-per = file assumption, which is also a key issue I have with PSR-4.=20 >=20 > That's a PSR-4 issue, not an autoloader one. Autoloaders, even in = composer, can use class maps to discover which file must be loaded to = make the symbol accessible, even if multiple unused symbols in that file = come along for the ride. My statement you are commenting on was about `spl_autoload` and PSR-4, = full stop. > 2. Symbol encapsulation =E2=80=94 Allowing symbols to be hidden from = code that should not use them. >=20 > Uhm, I'm not formally trained so that one got by me - could you please = give an example of this? I might have posted one already without = realizing it. Which part? Symbol, or Encapsulation? If Symbols, that is just the collective name for classes, interfaces, = enums, functions, constants and variables. If Encapsulation, then that means symbol hiding. PHP offers only = limited forms of symbol hiding with `private` and `protected`. = Currently it is not possible in PHP to have a top-level symbol in a = namespace =E2=80=94 vs. just a function, property or constant enclosed = in and as part of a class =E2=80=94 that a developer can disallow other = developers from accessing via regular access methods, e.g. instantiating = the class, implementing the interface, using the constant, calling the = function. etc. Does that answer? -Mike= --Apple-Mail=_0F114384-008B-4BD6-8561-C649689B2CEA Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8
On = Jul 3, 2024, at 8:24 PM, Michael Morris <tendoaki@gmail.com> = wrote:
On Wed, Jul = 3, 2024 at 7:52=E2=80=AFPM Mike Schinkel <mike@newclarity.net>= wrote:
Me personally, the opinions that I do not like are the = one-symbol-per file assumption, which is also a key issue I have with = PSR-4. 

That's a PSR-4 issue, not an autoloader = one. Autoloaders, even in composer, can use class maps to discover which = file must be loaded to make the symbol accessible, even if multiple = unused symbols in that file come along for the = ride.

My statement you are = commenting on was about `spl_autoload` and PSR-4, full stop.

2. Symbol encapsulation =E2=80=94 Allowing symbols to = be hidden from code that should not use = them.

Uhm, I'm not formally trained so that = one got by me - could you please give an example of this? I might have = posted one already without realizing = it.

Which = part?  Symbol, or Encapsulation?

If Symbols, that is just the collective name for = classes, interfaces, enums, functions, constants and = variables.

If Encapsulation, then = that means symbol hiding.  PHP offers only limited forms of symbol = hiding with `private` and `protected`.  Currently it is not = possible in PHP to have a top-level symbol in a namespace =E2=80=94 vs. = just a function, property or constant enclosed in and as part of a class = =E2=80=94 that a developer can disallow other developers from accessing = via regular access methods, e.g. instantiating the class, implementing = the interface, using the constant, calling the function. = etc.

Does that = answer?

-Mike
= --Apple-Mail=_0F114384-008B-4BD6-8561-C649689B2CEA--