#29612 [Opn->Bgs]: Variable $php_errormsg disappears
| From: | sniper@php.net | Date: | Sat, 28 Aug 2004 18:28:26 +0000 |
| Subject: | #29612 [Opn->Bgs]: Variable $php_errormsg disappears | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-65394@lists.php.net to get a copy of this message | ||
ID: 29612
Updated by: sniper@php.net
Reported By: tom at bitworks dot de
-Status: Open
+Status: Bogus
Bug Type: *Directory/Filesystem functions
Operating System: Debian woody Apache/1.3.27 (Unix
PHP Version: 4.3.8
New Comment:
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 http://www.php.net/support.php 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.
Previous Comments:
------------------------------------------------------------------------
[2004-08-11 13:30:23] tom at bitworks dot de
the open command was only:
$fh = fopen($dateiname,'xb');
without '+'
------------------------------------------------------------------------
[2004-08-11 13:28:21] tom at bitworks dot de
Description:
------------
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:
---------------
error_reporting(E_ALL);
ini_set('track_errors','1');
$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>';
print_r($_errors);
echo '</pre>';
}
else
{
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 />";
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=29612&edit=1