|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #29612 Variable $php_errormsg disappears
Submitted: 2004-08-11 13:28 UTC Modified: 2004-08-28 20:28 UTC
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: tom at bitworks dot de Assigned:
Status: Not a bug Package: *Directory/Filesystem functions
PHP Version: 4.3.8 OS: Debian woody Apache/1.3.27 (Unix
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.
Block user comment
Status: Assign to:
Bug Type:
From: tom at bitworks dot de
New email:
PHP Version: OS:


 [2004-08-11 13:28 UTC] tom at bitworks dot de
Searching for the behavior of all file functions and the right locking mechanisms I tried to use fopen(filename,xb) with former umask(0222). That was intended to trigger an error and look into $php_errormsg

But $php_errormsg was disappeared

Reproduce code:
$dateiname = 'opentest123.txt';
$mask = umask(0222);
echo "<br />Mask: $mask<br />";
$fh = fopen($dateiname,'xb+');
$_errors = debug_backtrace();
if (!$fh)
  echo "<br />Fehler: $php_errormsg<br />";
  echo "<br />Fehler: $php_errormsg<br />";
  echo '<pre>';
  echo '</pre>';
  echo "<br />Datei $dateiname wurde angelegt<br />";
  $write_ok = fwrite($fh, 'Testtext');
  echo "<br />Schreibversuch in $dateiname: $php_errormsg<br />";

Expected result:
Fehler: failed to open stream: Permission denied

Actual result:
Notice: Undefined variable: php_errormsg in /home/thomas/public_html/test/artikel_locking/opentest.php on line 27 

== echo "<br />Schreibversuch in $dateiname: $php_errormsg<br />";


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-08-11 13:30 UTC] tom at bitworks dot de
the open command was only:

$fh = fopen($dateiname,'xb');

without '+'
 [2004-08-28 20:28 UTC]
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

Ask support questions on how to use PHP elsewhere.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Feb 21 14:01:27 2024 UTC