Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:126568 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 71AC21A00BC for ; Tue, 4 Mar 2025 22:34:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1741127500; bh=Q45XLHoLleGZdkJaXbPF4Gqu8cw9CseTdmGHbvyew/c=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=CyTnK2B88+Mlh7z4Dwt4+IVevB1AX5PIV5w2dxUMczrjPy8vgNSeqRAWrYJLEN+LD CUX0AGsFo23xxo6zaTiD8cyAJigTqZNB+KIevhdGjia7Zm/EU8RbMomgeM3fY2ma7o CXAJiQcA3+EyMrXD9Z4PYHD5+72A965sR3mO6h02TdKKu/3BpSNqgvZ1GFwREScoDb hzdPTbkQPqdrTt5dGaJiyjbdpspv9Y9ssxnNrZA8suNFRye8Zx35AWNloyeFlB3D+h 3iU9KhgQ44Nz1xIV2O9RmyeM3CQkOQMxCC+ggLTo/YPvtr1koOqsTPMmgcH+EN9sW8 7WAd2AR8WFtjA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 7135C18005B for ; Tue, 4 Mar 2025 22:31:40 +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.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from chrono.xqk7.com (chrono.xqk7.com [176.9.45.72]) (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 ; Tue, 4 Mar 2025 22:31:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bastelstu.be; s=mail20171119; t=1741127655; bh=H5JeS+cjC1BnLSC8ZOUcgEl+feUHNE0fHe2z/5Xj+Mo=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type:from:to:cc:subject:message-id; b=R9zNRr+6hf5p23J4OfuQPRSqEL61W/bjC8F1HmXzCHOM3TwSm/TZGPSGX/wzA6Jea Ao7Cfoimx/wovFNkBepAc2X1obYNyeOxJHVxgfwoGjSWNNb5Sy/+sSD9TJHc4a0b7w PYoNKhkcGYbgNvOryegGW1oI/m1LWI7oQ7SvNRGVhEYMWYYg2w4GyX56YsKAUojSBy sn7Du4egWCfVsAlcWKaq/+SrGWiGm50q7kfLt+zQj1kYGlLIUKSZ5+uIzinrOXi6Wd XmttmDM0irjTMlEXjyRiBDtJNQZ1ga6PMt5r5xm+1NyVqy6d/SzPHYgw1dtkM2+nAS DOmD81q2l9S2w== Message-ID: <10f99b41-4124-485f-ac64-1df1498c8a43@bastelstu.be> Date: Tue, 4 Mar 2025 23:34:10 +0100 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 Subject: Re: [PHP-DEV] PHP socket ethernet support - step 2 To: "Gina P. Banyard" , Jakub Zelenka Cc: David CARLIER , PHP internals References: Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit From: tim@bastelstu.be (=?UTF-8?Q?Tim_D=C3=BCsterhus?=) 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. 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? And what is the payload object, is that just stdClass? Best regards Tim Düsterhus [1] https://github.com/php/policies/blob/main/coding-standards-and-naming.rst