|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2015-10-29 18:00 UTC] requinix@php.net
-Status: Open
+Status: Not a bug
[2015-10-29 18:00 UTC] requinix@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 08 23:00:01 2025 UTC |
Description: ------------ Using the following snippet, I get the correct response: var_dump(file_get_contents('my_local_file')); //Prints file contents fopen('my_local_file', 'r+'); var_dump(file_get_contents('my_local_file')); //Prints file contents again However, changing the mode in fopen to 'w+', causes weird behaviour: var_dump(file_get_contents('my_local_file')); //Prints file contents fopen('my_local_file', 'w+'); var_dump(file_get_contents('my_local_file')); //Prints an empty string Error is reproductible in PHP 5.6. Test script: --------------- <?php var_dump(file_get_contents('my_local_file')); //Prints file contents fopen('my_local_file', 'w+'); var_dump(file_get_contents('my_local_file')); //Prints an empty string