Re: PHP socket ethernet support - step 2

From: Date: Mon, 03 Mar 2025 21:20:50 +0000
Subject: Re: PHP socket ethernet support - step 2
References: 1  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
Hi,


> I am working on the second pass of this feature and write here because of
> the legitimate concern regarding new classes to add.
>
> PR here <https://github.com/php/php-src/pull/17926>
>

For those that want to quickly see the actually classes, here is a stub
link:
https://github.com/php/php-src/pull/17926/files#diff-190e64a9475f39f2b575e6032d6539b504b33fe534965e5bb3512fe430fe1846



> I agree also on adding a namespace on top (Sockets ?) and changing the
> class names.
>

I think it would be good to note that there are already two classes defined
in socket extension:

final class Socket
{
}

final class AddressInfo
{
}

So it might look a bit strange if those two are not namespaced and the new
ones are. The AddressInfo is a bit unfortunate name though. The namespace
seems cleaner but not sure if prefix would be more consistent. Although
having SocketPacket is not exactly nice so probably Socket\Packet is
better. But I don't really mind. I would just really prefer to not
introduce those classes without namespace or prefix.

Regards

Jakub


Thread (7 messages)

« previous php.internals (#126559) next »