|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-01-01 20:48 UTC] pajoye@php.net
[2010-08-12 00:07 UTC] kalle@php.net
-Status: Assigned
+Status: Feedback
[2010-08-12 00:07 UTC] kalle@php.net
[2010-08-12 00:25 UTC] pajoye@php.net
-Status: Feedback
+Status: Assigned
[2010-08-12 00:25 UTC] pajoye@php.net
[2010-08-12 01:32 UTC] viaujoc at videotron dot ca
-Status: Assigned
+Status: Closed
[2010-08-12 01:32 UTC] viaujoc at videotron dot ca
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 18:00:02 2025 UTC |
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]"