|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2019-10-14 12:18 UTC] cmb@php.net
-Status: Open
+Status: Not a bug
-Assigned To:
+Assigned To: cmb
[2019-10-14 12:18 UTC] cmb@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 14:00:01 2025 UTC |
Description: ------------ When injecting 0 byte in first parameter of file_get_contents this will produce a warning and should return FALSE according PHP documentation. But the return is NULL. Test script: --------------- $fc1 = file_get_contents("not-existing-file.txt"); $fc2 = file_get_contents("not-existing-file.txt\0"); echo PHP_EOL; var_dump($fc1); var_dump($fc2); Expected result: ---------------- PHP Warning: file_get_contents(not-existing-file.txt): failed to open stream: No such file or directory in /home/arch/php-fgc-test.php on line 2 PHP Warning: file_get_contents() expects parameter 1 to be a valid path, string given in /home/arch/php-fgc-test.php on line 3 bool(false) bool(false) Actual result: -------------- PHP Warning: file_get_contents(not-existing-file.txt): failed to open stream: No such file or directory in /home/arch/php-fgc-test.php on line 2 PHP Warning: file_get_contents() expects parameter 1 to be a valid path, string given in /home/arch/php-fgc-test.php on line 3 bool(false) NULL