I'd like to request a function to retrieve the IP address(es) of a given network interface... something that would let me:
$ip = ifaddr("eth0");
maybe even something more general like:
$info = ifconfig("eth0")
echo $info["HWAddr"], $info["Mask"];
echo $info["RX-packets"], $info["RX-errors"],
etc.

Because _nobody_ should have to wait more than a decade for a decent answer:
https://gist.github.com/krakjoe/7181349
Not able to attach patch to bug, will do when systems are fixed ... stupid hackers ...
Who is gonna do windows ??

Oh I forgot to mention, we can provide some of the information you requested in a portable (across posix implementations) way.
It's not so easy to provide RX/TX counters and status.
Providing proper names and addresses should allow you to write the non-portable stuff for the platform you are targeting, in php ...

Hi Ferenc,
heh, no implementation started, and will not be soon unfortunately. Still too much stuff for master + ongoing bugs for stable branches. Thanks for poking, I'll keep this one in mind (except one took over before).
Cheers
Anatol

So was it in the Joe's original patch, I just extended it with the Windows part. But i'm not sure we should take it - Joe seems to be not interested/busy, so I'm not sure a sufficient testing can be done.
Thanks.

I just forgot about this ... it would be nice if we could implement at least one of these 15 year old feature requests ...
I still think this is valuable, many places in php can actually make use of interface names but we still have no good way to determine them.
@ab can you fixup for master please, and open a clean PR on github ?

@joe I think the implementation looks just fine, but as I noted earlier it should probably be located in main/ or ext/standard and use the naming convention we already have inherited, like getnetworkinterfaces() or something in the manner

With permission from joe and anatol, I've adopted their diff and merged it with my own and produced: https://github.com/php/php-src/pull/2935
Planning to merge it to 7.3 soon, unless internals@ has objections.