Req #67601 [Opn->Wfx]: ip2long(), or a successor needs to support IPv6
| From: | cmb@php.net | Date: | Mon, 07 Dec 2020 13:46:59 +0000 |
| Subject: | Req #67601 [Opn->Wfx]: ip2long(), or a successor needs to support IPv6 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-230903@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=67601&edit=1
ID: 67601
Updated by: cmb@php.net
Reported by: gem at rellim dot com
Summary: ip2long(), or a successor needs to support IPv6
-Status: Open
+Status: Wont fix
Type: Feature/Change Request
Package: *Network Functions
Operating System: any
PHP Version: 5.5.14
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
IPv6 uses 128bit addresses; these cannot be converted to int, like
jc already said, so this request makes no sense. Also, like jc
already pointed out, there is inet_pton() which can be combined
with other existing functions to get a numeric string[1].
> in 2017 PHP needs to support ipv6 without userland
Well, it's 2020, so this claim is no longer relevant.
[1] <https://3v4l.org/tad1D>
Previous Comments:
------------------------------------------------------------------------
[2017-06-26 22:07:17] spam2 at rhsoft dot net
> get back to me when PHP_INT_MAX returns 170141183460469231731687303715884105727
that's ridiculous at it's own on modern hardware and a weak excuse
------------------------------------------------------------------------
[2017-06-26 22:04:39] jc at unternet dot net
"PHP needs to support ipv6 without userland code needs to know about it at all - period"
get back to me when PHP_INT_MAX returns 170141183460469231731687303715884105727
------------------------------------------------------------------------
[2017-06-26 19:41:50] gem at rellim dot com
"in 2017 PHP needs to support ipv6 without userland code needs to know about it at all -
period"
+1
------------------------------------------------------------------------
[2017-06-26 19:30:29] spam2 at rhsoft dot net
besides of RFC and what not - "for an easy workaround:
gmp_import(inet_pton($ip));" is crap - in 2017 PHP needs to support ipv6 without
userland code needs to know about it at all - period
------------------------------------------------------------------------
[2017-06-26 19:27:31] jc at unternet dot net
new features require approved RFC as per https://github.com/php/php-src/
128 bits cannot fit into a long int anyway, assuming "long" is defined as 64 bits. see https://stackoverflow.com/a/37250452/493161
for an easy workaround: gmp_import(inet_pton($ip));
I vote to close.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=67601
--
Edit this bug report at https://bugs.php.net/bug.php?id=67601&edit=1