php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #76735 Incorrect message in fopen on invalid mode
Submitted: 2018-08-13 07:19 UTC Modified: -
Votes:1
Avg. Score:1.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: robert dot jelen at email dot cz Assigned:
Status: Open Package: Streams related
PHP Version: 7.1.20 OS: Debian
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2018-08-13 07:19 UTC] robert dot jelen at email dot cz
Description:
------------
The message claims success, although it is a warning and the file fails to open. 

Test script:
---------------
<?php

$f = fopen('existing.file', 'Q');


Expected result:
----------------
PHP Warning:  fopen(existing.file): failed to open stream: Mode "Q" is not valid in /home/robert/test.php on line 3

Actual result:
--------------
PHP Warning:  fopen(existing.file): failed to open stream: Success in /home/robert/test.php on line 3

Patches

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2018 The PHP Group
All rights reserved.
Last updated: Tue Dec 11 22:01:26 2018 UTC