Comments (4)
First thing I see is in the new usage of getnameinfo: the code checks <0 for error but MSDN and getnameinfo(3) lists it as merely returning non-zero.
from php-src.
I can confirm issue on Win10 x64
PS C:\Users\wapin> php -v
PHP 8.0.13 (cli) (built: Nov 16 2021 21:58:37) ( ZTS Visual C++ 2019 x64 )
Copyright (c) The PHP Group
Zend Engine v4.0.13, Copyright (c) Zend Technologies
with Zend OPcache v8.0.13, Copyright (c), by Zend Technologies
with Xdebug v3.1.2, Copyright (c) 2002-2021, by Derick Rethans
PS C:\Users\wapin> php -a
Interactive shell
php > var_dump(gethostbyaddr('89.222.225.0'));
php shell code:1:
string(12) "89.222.225.0"
php > var_dump(gethostbyaddr('192.88.99.1'));
php shell code:1:
string(11) "192.88.99.1"
PS S:\php81> ./php -v
PHP 8.1.0 (cli) (built: Nov 23 2021 21:48:28) (ZTS Visual C++ 2019 x64)
Copyright (c) The PHP Group
Zend Engine v4.1.0, Copyright (c) Zend Technologies
PS S:\php81> ./php -a
Interactive shell
php > var_dump(gethostbyaddr('89.222.225.0'));
string(0) ""
php > var_dump(gethostbyaddr('192.88.99.1'));
string(0) ""
from php-src.
it also depends somehow from the previous (working) result
<?php
var_dump(gethostbyaddr('80.1.2.3'));
var_dump(gethostbyaddr('89.222.225.0'));
var_dump(gethostbyaddr('192.88.99.1'));
^Z
string(49) "cpc99474-lich12-2-0-cust514.3-2.cable.virginm.net"
string(16) "cpc99474-lich12-"
string(16) "cpc99474-lich12-"
from php-src.
@remicollet what was the reason to use getnameinfo in php_gethostbyaddr instead of gethostbyaddr (which is exactly what this function does)? I can't find discussion or bug # about that change.
I do like this little quote from various OSes doc, incl. windows one:
Note The ability to perform reverse DNS lookups using the getnameinfo function is convenient, but such lookups are considered inherently unreliable, and should be used only as a hint.
from php-src.
Related Issues (20)
- PECL list-upgrade doesn't seems to respect php versions HOT 4
- Removal during NodeList iteration breaks loop HOT 2
- Improve deprecation message for implicit nullable parameters HOT 3
- number_format() changed undocumented behaviour since PHP 8.3.0 HOT 5
- do_operation ZEND_BOOL_NOT not invoked HOT 1
- `preg_match` require match HOT 1
- auto_prepend_file register_shutdown_function TypeError fatal error because function not hoisted HOT 2
- [Chore] Officially support musl the same way glibc is supported HOT 11
- php.ini INI_SYSTEM: local value of "sys_temp_dir" does not overide master value and can bypass "open_basedir" (not a security issue FMPOV)
- Signed integer overflow in ext/date/lib/unixtime2tm.c
- ARM64 + BSD15 - CGI PHP - 502 Bad Gateway error HOT 5
- stream_select fails on blocking sockets except for incoming connections HOT 2
- FR: allow use class constant interpolation in strings HOT 1
- === Total 1 memory leaks detected === zend_mm_heap corrupted Segmentation fault HOT 2
- [ feature/fix ] Internal functions needs exactly number of arguments needs to be optimized / And few more old bugs HOT 5
- Stack buffer underflow when executing copy() HOT 7
- Invalid nameserver delays php-cli execution HOT 2
- SplFileObject: foreach doesn't start from the correct line after `SplFileObject::seek()` HOT 3
- AVIF image errors HOT 3
- File system group permission with is_readable and is_writable is not being honored HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from php-src.