From 8c5c0ce29c51d7b81ecf9515eff9138ef553ae7c Mon Sep 17 00:00:00 2001 From: Antony Dovgal Date: Thu, 9 Nov 2006 00:33:54 +0000 Subject: [PATCH] fix test and prevent endless loop --- ext/standard/tests/file/bug27508.phpt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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"); -- 2.50.1