Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:126577 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 BE51B1A00BC for ; Wed, 5 Mar 2025 12:11:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1741176548; bh=xjczLaSQsv0qy/+3Muj9HoRve9B7TyCx6ipphjeotxg=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=cKyRIe8gVOzNt3vkOs9/ny1lnJm8DNKHX7ueVfwT31omNPf+yS5aMkM+1o+LqyILv yPg4zoZ5IqmDN5FURcxXcr5FItdmrq7d2xoOP0Gnpow9eJKKok0LjCjGXaa3LyIRRC 6Ez8i1IIUPEjri9qogPsqs591CB8a2lG+v77RnIkG6lcH70JTxl0TMXAfX0Kvc6JMy 7Wx0gTDzCBAnaJg+ef7b6Li4v1igiP/xomWD90CGLa12KKcwAu3Aj0i/PiPOjBhhNq G7Cm4rXx1V4BaA0pLkvD2RSHBKhTLX8Pi+zHleJZheHggmf2c3f17YWXMK3H//wKIz eKuE1uZyjctFA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 9B6EC180081 for ; Wed, 5 Mar 2025 12:09:07 +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.2 required=5.0 tests=BAYES_20,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.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-oa1-f42.google.com (mail-oa1-f42.google.com [209.85.160.42]) (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 ; Wed, 5 Mar 2025 12:09:07 +0000 (UTC) Received: by mail-oa1-f42.google.com with SMTP id 586e51a60fabf-2c1be520943so1720106fac.0 for ; Wed, 05 Mar 2025 04:11:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1741176702; x=1741781502; 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=xjczLaSQsv0qy/+3Muj9HoRve9B7TyCx6ipphjeotxg=; b=ElN5gFNybhkuNN+SrDpuv3kj4BKmSFIIZb//aMLzgbFdpI3zA6aZIEOeLcdIXD2ExJ 9U3+VcNsZxxI98gSAXRQvuOXWOY66r19BEd8PEiZ0P3vCHR/xzOXwZbsDivmhf2hdnVs BL4MZh7tMm7lLMD84RSIYuQKUNHvI/WLak467axagE44acnJOsB3NNuU+G1LXWYICEts dOEpRQSX/qNGC1BT5GnYnXNsnfr7mBTjyl5fEoTKwDmxLUxUHwgiYDA+STafidVJob82 9t3u2HF22AIqrn5vrOBqcPdVpm0aJBUYhLgBhXczDvi29Izm8PocZunhKtzjb1LEuIjh 0mlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741176702; x=1741781502; 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=xjczLaSQsv0qy/+3Muj9HoRve9B7TyCx6ipphjeotxg=; b=nRvBnQDk/Ahtul+1KAC5RB/LzNDWf9dbDstPwSapLAdGtjr2F4Sk5dbxwQv6Ugwh4F ZS6G1sUl7K40VLk2bo8gVVjskIHrLVRD6A4hc2LdFAcy63gwumXTH2P6JMvpVaDK5iqA 7YnB0kEwtRqHZ6auEyk9qvVmr4WgulWI8MehJmWDyCh3xTOJklYgXXZOXlJeL8tTFs+H ciskS27UUS8xeI3FkmH9+i/AH4ZT7J1m9Oc2vNi7x3X/dUkVB4tooxrhcTifKzcfeExb Iu1LS5ntKFS2M7HSd3GL6nSuV3+jf/CjidCkVmJMaiXisjR8vtV6xKChvrbJ7waaioxF Kz0A== X-Forwarded-Encrypted: i=1; AJvYcCWz7XRtlRwqhcQE8ISmLCsRk+1PrgKAcVMb7SC1VOnbZC7IwIAGZavDb/zzIphyxdm1eKgCnGvGDiE=@lists.php.net X-Gm-Message-State: AOJu0YwV4iw7YF6NXMzUaScXmhRR2q0O0C+tU2pgzUPJD9YBiv8mLbxL Xf2AreyT793wmT2Fx6xpi0uj8zGof+dU3ZDIV8A9VIayKvLZJUWDC6lGEFAAj0/WMUk68lgdNFY EtWZObfkljxlNUHzpOfEdM405/go2IQ== X-Gm-Gg: ASbGnctaHGxrVNm7OckBP+y2+kfZhlWpWDYY01PLxbbmTUgHfEQoaTuKyKvKhZN5UQT 1K8PCSkbl1A3kPAnsosvEruu8fCM7rj4glNhQwGVKjp+pxO5Cr8JbZvNE0jlsQ4vHbflXuoZzaX gKaps09iwO3Di7ZSxX2zvSGwnS X-Google-Smtp-Source: AGHT+IHOwqFgiSTHD1A2FWZHG4xb9VWu9+1cNFCRepGXM/84pNvHaOMt76NW4BqwpizCucO4qty+INfC14Tq23dd36w= X-Received: by 2002:a05:6870:6110:b0:2c1:5674:940e with SMTP id 586e51a60fabf-2c21caf2a12mr1440029fac.21.1741176702299; Wed, 05 Mar 2025 04:11:42 -0800 (PST) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 References: <10f99b41-4124-485f-ac64-1df1498c8a43@bastelstu.be> In-Reply-To: <10f99b41-4124-485f-ac64-1df1498c8a43@bastelstu.be> Date: Wed, 5 Mar 2025 12:11:30 +0000 X-Gm-Features: AQ5f1JoGTYhms1HvO13GSnQZVhwTgfO4VucClu6mlLCdUgbRCF1FTKiii2G2tAg Message-ID: Subject: Re: [PHP-DEV] PHP socket ethernet support - step 2 To: =?UTF-8?Q?Tim_D=C3=BCsterhus?= Cc: "Gina P. Banyard" , Jakub Zelenka , PHP internals Content-Type: multipart/alternative; boundary="000000000000d4f90c062f974a75" From: devnexen@gmail.com (David CARLIER) --000000000000d4f90c062f974a75 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, 4 Mar 2025 at 22:34, Tim D=C3=BCsterhus wrote: > Hi > > On 3/4/25 23:18, Gina P. Banyard wrote: > > Those two classes predate the Namespaces in bundled PHP extensions [1] > RFC, I do think adding a namespace is better. > > And we could also move the two classes into the new namespace and add > class aliases for the global ones, considering they are quite recent > additions to PHP. > > I agree that adding a namespace would be appropriate here. Looking at > the sockets.stub.php, it pollutes the global namespace quite a bit. I > probably miscounted, but it appears to be at least 10 different prefixes > for the global constants. > Ok I ll go the namespace route then, fair point. > > It would probably be in order to also alias all the constants into the > namespace (possibly converting them to enums where appropriate) and then > in a follow-up version deprecate the global ones. I think that would > bring quite a bit of positive impact, for minimal effort. > > -------- > > As for the classes themselves: It does not appear to be defined in our > naming policy [1], but the properties should likely use camel-case, as > that is the established convention for userland code. And I'm also > curious why the port properties are strings, not ints? Yes it is a definition mistake it means to be a int indeed. > And what is the > payload object, is that just stdClass? > Not really it's supposed to be one of the new classes. > > Best regards > Tim D=C3=BCsterhus > > [1] > https://github.com/php/policies/blob/main/coding-standards-and-naming.rst > --000000000000d4f90c062f974a75 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Tue, 4 Mar 2= 025 at 22:34, Tim D=C3=BCsterhus <ti= m@bastelstu.be> wrote:
Hi

On 3/4/25 23:18, Gina P. Banyard wrote:
> Those two classes predate the Namespaces in bundled PHP extensions [1]= RFC, I do think adding a namespace is better.
> And we could also move the two classes into the new namespace and add = class aliases for the global ones, considering they are quite recent additi= ons to PHP.

I agree that adding a namespace would be appropriate here. Looking at
the sockets.stub.php, it pollutes the global namespace quite a bit. I
probably miscounted, but it appears to be at least 10 different prefixes for the global constants.

Ok I ll go th= e namespace route then, fair point.=C2=A0

It would probably be in order to also alias all the constants into the
namespace (possibly converting them to enums where appropriate) and then in a follow-up version deprecate the global ones. I think that would
bring quite a bit of positive impact, for minimal effort.

--------

As for the classes themselves: It does not appear to be defined in our
naming policy [1], but the properties should likely use camel-case, as
that is the established convention for userland code. And I'm also
curious why the port properties are strings, not ints?
Ye= s it is a definition mistake it means to be a int indeed.
=C2=A0<= /div>
And what is the
payload object, is that just stdClass?

= =C2=A0Not really it's supposed to be one of the new classes.

Best regards
Tim D=C3=BCsterhus

[1]
https://github.com/php/poli= cies/blob/main/coding-standards-and-naming.rst
--000000000000d4f90c062f974a75--