|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-12-10 09:41 UTC] jani@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 11:00:01 2025 UTC |
Description: ------------ When running a PHP script as CLI, after setting stream_set_blocking($x,0), invoking an infinite loop which includes a print statement causes spontaneous script termination after an indeterminate number of iterations. Omitting stream_set_blocking() eliminates the problem. Tested and confirmed this behaviour on PHP 5.2.3 and PHP 5.2.5 on several FreeBSD systems. Reproduce code: --------------- This works as expected: <?php stream_set_blocking(STDIN,0); do { } while(TRUE); ?> However, after introducing a print statement to the loop, the script appears to spontaneously terminate after a number of iterations. <?php stream_set_blocking(STDIN,0); do { print "!"; } while(TRUE); ?> Expected result: ---------------- Script should loop indefinately. Actual result: -------------- Script terminates on it's own. Any code following the loop is not executed.