php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #72075 Referencing socket resources breaks stream_select
Submitted: 2016-04-22 09:16 UTC Modified: -
From: php at vanviegen dot net Assigned:
Status: Closed Package: Streams related
PHP Version: 7.0.5 OS: Debian
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: php at vanviegen dot net
New email:
PHP Version: OS:

 

 [2016-04-22 09:16 UTC] php at vanviegen dot net
Description:
------------
Creating references to socket resources causes these resources to no longer work in stream_select.

Test script:
---------------
$r = [stream_socket_server("tcp://127.0.0.1:0", $errno, $errStr)];
$w = NULL;
$e = NULL;

// Without this line, all is well:
$dummy =& $r[0];

print stream_select($r, $w, $e, 3);


Expected result:
----------------
The script should hang for 3s. This is indeed what happens with PHP 5.

Actual result:
--------------
PHP Warning:  stream_select(): supplied argument is not a valid stream resource in test.php on line 10
PHP Warning:  stream_select(): No stream arrays were passed in test.php on line 10


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-04-23 04:22 UTC] laruence@php.net
Automatic comment on behalf of laruence@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=9eb7c8cd3b202ff77f1442f5a5d3107bd7fc3a18
Log: Fixed bug #72075 (Referencing socket resources breaks stream_select)
 [2016-04-23 04:22 UTC] laruence@php.net
-Status: Open +Status: Closed
 [2016-07-20 11:31 UTC] davey@php.net
Automatic comment on behalf of laruence@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=9eb7c8cd3b202ff77f1442f5a5d3107bd7fc3a18
Log: Fixed bug #72075 (Referencing socket resources breaks stream_select)
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri Jan 31 01:01:29 2025 UTC