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: 2020-09-22 12:51 UTC
Votes:2
Avg. Score:2.0 ± 1.0
Reproduced:0 of 0 (0.0%)
From: robert dot jelen at email dot cz Assigned: cmb (profile)
Status: Closed Package: Streams related
PHP Version: 7.1.20 OS: Debian
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: robert dot jelen at email dot cz
New email:
PHP Version: OS:

 

 [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

Pull requests:

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-09-22 12:51 UTC] cmb@php.net
-Status: Open +Status: Verified -Assigned To: +Assigned To: cmb
 [2020-09-22 12:51 UTC] cmb@php.net
I can confirm the erroneous error message, although it is not
necessarily "Success", but rather what corresponds to the current
`errno`.
 [2020-09-22 12:59 UTC] cmb@php.net
The following pull request has been associated:

Patch Name: Fix #76735: Incorrect message in fopen on invalid mode
On GitHub:  https://github.com/php/php-src/pull/6187
Patch:      https://github.com/php/php-src/pull/6187.patch
 [2020-09-23 09:15 UTC] cmb@php.net
Automatic comment on behalf of cmbecker69@gmx.de
Revision: http://git.php.net/?p=php-src.git;a=commit;h=2576c57a5133df757c51f341e794bf53add7663f
Log: Fix #76735: Incorrect message in fopen on invalid mode
 [2020-09-23 09:15 UTC] cmb@php.net
-Status: Verified +Status: Closed
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sun Oct 25 08:01:24 2020 UTC