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
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

Add a Pull Request

 
PHP Copyright © 2001-2018 The PHP Group
All rights reserved.
Last updated: Mon Dec 10 08:01:24 2018 UTC