From: Antony Dovgal Date: Thu, 9 Nov 2006 00:33:54 +0000 (+0000) Subject: fix test and prevent endless loop X-Git-Tag: RELEASE_1_0_0RC1~1099 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8c5c0ce29c51d7b81ecf9515eff9138ef553ae7c;p=php fix test and prevent endless loop --- diff --git a/ext/standard/tests/file/bug27508.phpt b/ext/standard/tests/file/bug27508.phpt index 95a3122184..cc4c8b87b6 100644 --- a/ext/standard/tests/file/bug27508.phpt +++ b/ext/standard/tests/file/bug27508.phpt @@ -30,6 +30,9 @@ class FileStream { function stream_eof() { + if (!$this->fp) { + return true; + } return feof($this->fp); } @@ -44,7 +47,7 @@ stream_wrapper_register("myFile", "FileStream") $tn = tempnam('/tmp', 'foo'); -$fp = fopen("myFile://" . urlencode($tn), "w+"); +$fp = fopen("myFile://" . urlencode((binary)$tn), "w+"); fwrite($fp, b"line1\n"); fwrite($fp, b"line2\n");