|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-05-26 10:35 UTC] tony at daylessday dot org
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 22 22:00:02 2025 UTC |
Description: ------------ event_buffer_enable returns false when I use fopen. But it works normal when I use popen() or fsockopen(). Reproduce code: --------------- <?php function print_line($buf, $arg) {echo event_buffer_read($buf, 4096);} function error_func($buf, $what, $arg) {} $base = event_base_new(); $fp = fopen(__FILE__,'r'); $eb = event_buffer_new($fp, "print_line", NULL, "error_func", $base); $set = event_buffer_base_set($eb, $base); $enabled = event_buffer_enable($eb, EV_READ); var_dump(array( 'fp' => $fp, 'eb' => $eb, 'set' => $set, 'enabled' => $enabled) ); event_base_loop($base); Expected result: ---------------- array(4) { ["fp"]=> resource(6) of type (stream) ["eb"]=> resource(7) of type (buffer event) ["set"]=> bool(true) ["enabled"]=> bool(true) } // source code bellow Actual result: -------------- array(4) { ["fp"]=> resource(6) of type (stream) ["eb"]=> resource(7) of type (buffer event) ["set"]=> bool(true) ["enabled"]=> bool(false) }