File tree Expand file tree Collapse file tree 3 files changed +33
-1
lines changed Expand file tree Collapse file tree 3 files changed +33
-1
lines changed Original file line number Diff line number Diff line change @@ -404,6 +404,11 @@ PHP 7.4 UPGRADE NOTES
404
404
// $str = ReflectionClass::export(Foo::class, true) is:
405
405
$str = (string) new ReflectionClass(Foo::class);
406
406
407
+ - Socket:
408
+ . The AI_IDN_ALLOW_UNASSIGNED and AI_IDN_USE_STD3_ASCII_RULES flags for
409
+ socket_addrinfo_lookup() are deprecated, due to an upstream deprecation in
410
+ glibc.
411
+
407
412
- Standard:
408
413
. Passing invalid characters to ''base_convert()'', ''bindec()'', ''octdec()''
409
414
and ''hexdec()'' will now generate a deprecation notice. The result will
Original file line number Diff line number Diff line change @@ -2573,7 +2573,14 @@ PHP_FUNCTION(socket_addrinfo_lookup)
2573
2573
ZEND_HASH_FOREACH_STR_KEY_VAL (Z_ARRVAL_P (zhints ), key , hint ) {
2574
2574
if (key ) {
2575
2575
if (zend_string_equals_literal (key , "ai_flags" )) {
2576
- hints .ai_flags = zval_get_long (hint );
2576
+ zend_long flags = zval_get_long (hint );
2577
+ #if HAVE_AI_IDN
2578
+ if (flags & (AI_IDN_ALLOW_UNASSIGNED | AI_IDN_USE_STD3_ASCII_RULES )) {
2579
+ php_error_docref (NULL , E_DEPRECATED ,
2580
+ "AI_IDN_ALLOW_UNASSIGNED and AI_IDN_USE_STD3_ASCII_RULES are deprecated" );
2581
+ }
2582
+ #endif
2583
+ hints .ai_flags = flags ;
2577
2584
} else if (zend_string_equals_literal (key , "ai_socktype" )) {
2578
2585
hints .ai_socktype = zval_get_long (hint );
2579
2586
} else if (zend_string_equals_literal (key , "ai_protocol" )) {
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ AI_IDN_ALLOW_UNASSIGNED and AI_IDN_USE_STD3_ASCII_RULES are deprecated
3
+ --SKIPIF--
4
+ <?php
5
+ if (!extension_loaded ('sockets ' )) die ('skip The sockets extension is not loaded ' );
6
+ if (!defined ('AI_IDN_ALLOW_UNASSIGNED ' )) die ('skip AI_IDN_ALLOW_UNASSIGNED not defined ' );
7
+ ?>
8
+ --FILE--
9
+ <?php
10
+ $ addrinfo = socket_addrinfo_lookup ('127.0.0.1 ' , 2000 , array (
11
+ 'ai_family ' => AF_INET ,
12
+ 'ai_socktype ' => SOCK_DGRAM ,
13
+ 'ai_flags ' => AI_IDN_ALLOW_UNASSIGNED ,
14
+ ));
15
+ var_dump (socket_addrinfo_connect ($ addrinfo [0 ]));
16
+ echo "Done " ;
17
+ --EXPECTF --
18
+ Deprecated: socket_addrinfo_lookup(): AI_IDN_ALLOW_UNASSIGNED and AI_IDN_USE_STD3_ASCII_RULES are deprecated in %s on line %d
19
+ resource (%d) of type (Socket)
20
+ Done
You can’t perform that action at this time.
0 commit comments