Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b394654

Browse files
committed
Merge branch 'PHP-7.2' into PHP-7.3
2 parents d4867e0 + 9a74b23 commit b394654

3 files changed

Lines changed: 7 additions & 0 deletions

File tree

NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ PHP NEWS
1818
. Fixed bug #78015 (Incorrect evaluation of expressions involving partials
1919
arrays in SCCP). (Nikita)
2020

21+
- Sockets:
22+
. Fixed bug #78038 (Socket_select fails when resource array contains
23+
references). (Nikita)
24+
2125
16 May 2019, PHP 7.3.6RC1
2226

2327
- cURL:

ext/sockets/sockets.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -898,6 +898,7 @@ static int php_sock_array_to_fd_set(zval *sock_array, fd_set *fds, PHP_SOCKET *m
898898
if (Z_TYPE_P(sock_array) != IS_ARRAY) return 0;
899899

900900
ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(sock_array), element) {
901+
ZVAL_DEREF(element);
901902
php_sock = (php_socket*) zend_fetch_resource_ex(element, le_socket_name, le_socket);
902903
if (!php_sock) continue; /* If element is not a resource, skip it */
903904

@@ -926,6 +927,7 @@ static int php_sock_array_from_fd_set(zval *sock_array, fd_set *fds) /* {{{ */
926927

927928
array_init(&new_hash);
928929
ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(sock_array), num_key, key, element) {
930+
ZVAL_DEREF(element);
929931
php_sock = (php_socket*) zend_fetch_resource_ex(element, le_socket_name, le_socket);
930932
if (!php_sock) continue; /* If element is not a resource, skip it */
931933

ext/sockets/tests/socket_select.phpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ socket_create_pair($domain, SOCK_STREAM, 0, $sockets);
1717

1818
$write = null;
1919
$except = null;
20+
$ref =& $sockets[0]; // bug #78038
2021
var_dump(socket_select($sockets, $write, $except, 0));
2122
--EXPECT--
2223
int(0)

0 commit comments

Comments
 (0)