Edit report at http://bugs.php.net/bug.php?id=50629&edit=1
ID: 50629 Updated by: ka...@php.net Reported by: viaujoc at videotron dot ca Summary: Invalid CRT parameters detected in stream_get_contents() -Status: Assigned +Status: Feedback Type: Bug Package: Streams related Operating System: win32 only - Win2003 PHP Version: 5.3.1 Assigned To: pajoye Block user comment: N New Comment: Please try using this snapshot: http://snaps.php.net/php5.3-latest.tar.gz For Windows: http://windows.php.net/snapshots/ I cannot reproduce this with PHP trunk on Vista x86/VC9 Previous Comments: ------------------------------------------------------------------------ [2010-01-01 20:48:20] paj...@php.net Have to reproduce it. ------------------------------------------------------------------------ [2010-01-01 19:45:05] viaujoc at videotron dot ca Description: ------------ When using stream_get_contents() without the $maxlength argument, the warning "Warning: Invalid CRT parameters detected" is showing up. This only happens in PHP 5.3.1, it works correctly in PHP 5.2.12. Adding a very large value to $maxlength, even much larger than the actual content to be retrieve makes the warning go away. Reproduce code: --------------- <?php $sock = fsockopen("127.0.0.1",80); $writeStr = "GET / HTTP/1.0\r\n\r\n"; for ($written = 0; $written < strlen($writeStr); $written += $fwrite) { $fwrite = fwrite($sock,substr($writeStr,$written)); if (!$fwrite) break; } $data = stream_get_contents($sock); var_dump($data); ?> Expected result: ---------------- The warning "Warning: Invalid CRT parameters detected" should not show up, it does not in PHP 5.2.12. In both PHP 5.2.12 and 5.3.1, $data is containing the same thing. Actual result: -------------- Warning: Invalid CRT parameters detected in D:\wwwroot\Dev\Framework_TestApp\bug.php on line 8 string(726) "HTTP/1.1 200 OK Content-Length: 555 Content-Type: text/html Server: Microsoft-IIS/6.0 X-Powered-By: ASP.NET Date: Fri, 01 Jan 2010 19:34:36 GMT Connection: close <html><head><META http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>127.0.0.1 - /</title></head><body><H1>127.0.0.1 - /</H1><hr> <pre> [... the rest of $data is here]" ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=50629&edit=1