Bug #71849 [Com]: file_get_contents returns undocumented type

From: Date: Fri, 18 Mar 2016 00:18:06 +0000
Subject: Bug #71849 [Com]: file_get_contents returns undocumented type
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-199910@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=71849&edit=1 ID: 71849 Comment by: hanskrentel at yahoo dot de Reported by: hanskrentel at yahoo dot de Summary: file_get_contents returns undocumented type Status: Open Type: Bug Package: *General Issues Operating System: Linux PHP Version: 7.0.4 Block user comment: N Private report: N New Comment: Example is <https://3v4l.org/33O0B>: <?php var_dump(file_get_contents("\0")); Previous Comments: ------------------------------------------------------------------------ [2016-03-18 00:13:56] hanskrentel at yahoo dot de Description: ------------ I managed to make file_get_contents() return NULL which is undocumented (string and FALSE is documented). Technically the case ("\0" as filename) triggers a warning so might not construe an error, but actually smells a lot like an error finally and should be FALSE. This would also reduce handling return value logic. So far it's merely unnoticed as undocumented, no idea if it's a technical difficulty to fix or just an oversight. As this is NUL byte related this might make underlying problems visible. As I'm undecided, I filed it as bug. It could be a documentation problem or security issue. Also a change request. As it could be all three, I filed it as bug which is undefined as well. HTH ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=71849&edit=1

« previous php.bugs (#199910) next »