]> granicus.if.org Git - php/commitdiff
Add inet_ntop and inet_pton stubs
authorIslam Israfilov <irisrafilov@avito.ru>
Tue, 13 Aug 2019 11:11:49 +0000 (13:11 +0200)
committerChristoph M. Becker <cmbecker69@gmx.de>
Tue, 13 Aug 2019 12:52:14 +0000 (14:52 +0200)
ext/standard/basic_functions.c
ext/standard/basic_functions.stub.php
ext/standard/basic_functions_arginfo.h

index fbb435616fdb7b2c36d582404f38e8bb337ed181..0ae281c3633c10b7c8c83b1f1a0b8f532c711c36 100644 (file)
@@ -523,18 +523,6 @@ ZEND_BEGIN_ARG_INFO(arginfo_constant, 0)
        ZEND_ARG_INFO(0, const_name)
 ZEND_END_ARG_INFO()
 
-#ifdef HAVE_INET_NTOP
-ZEND_BEGIN_ARG_INFO(arginfo_inet_ntop, 0)
-       ZEND_ARG_INFO(0, in_addr)
-ZEND_END_ARG_INFO()
-#endif
-
-#ifdef HAVE_INET_PTON
-ZEND_BEGIN_ARG_INFO(arginfo_inet_pton, 0)
-       ZEND_ARG_INFO(0, ip_address)
-ZEND_END_ARG_INFO()
-#endif
-
 ZEND_BEGIN_ARG_INFO(arginfo_ip2long, 0)
        ZEND_ARG_INFO(0, ip_address)
 ZEND_END_ARG_INFO()
index 9d6833c6395707e165191636091271994578ce69..fcc804f6f71a8152d8fb3291947fd98ea4d17cf1 100644 (file)
@@ -84,3 +84,13 @@ function closelog (): bool {}
 
 function syslog (int $priority, string $message): bool {}
 #endif
+
+#ifdef HAVE_INET_NTOP
+/** @return string|false */
+function inet_ntop (string $in_addr) {}
+#endif
+
+#ifdef HAVE_INET_PTON
+/** @return string|false */
+function inet_pton (string $ip_address) {}
+#endif
index e3300cbcec2602ae392df7d151827967adaa75d6..a32e8991f765fef714bcd7e14049d6347aede48a 100644 (file)
@@ -107,3 +107,15 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_syslog, 0, 2, _IS_BOOL, 0)
        ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0)
 ZEND_END_ARG_INFO()
 #endif
+
+#if defined(HAVE_INET_NTOP)
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_inet_ntop, 0, 1, 0, 0)
+       ZEND_ARG_TYPE_INFO(0, in_addr, IS_STRING, 0)
+ZEND_END_ARG_INFO()
+#endif
+
+#if defined(HAVE_INET_PTON)
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_inet_pton, 0, 1, 0, 0)
+       ZEND_ARG_TYPE_INFO(0, ip_address, IS_STRING, 0)
+ZEND_END_ARG_INFO()
+#endif
\ No newline at end of file