From: tom at bitworks dot de Operating system: Debian woody Apache/1.3.27 (Unix PHP version: 4.3.8 PHP Bug Type: *Directory/Filesystem functions Bug description: Variable $php_errormsg disappears
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 bug report at http://bugs.php.net/?id=29612&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=29612&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=29612&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=29612&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=29612&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=29612&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=29612&r=needscript Try newer version: http://bugs.php.net/fix.php?id=29612&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=29612&r=support Expected behavior: http://bugs.php.net/fix.php?id=29612&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=29612&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=29612&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=29612&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=29612&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=29612&r=dst IIS Stability: http://bugs.php.net/fix.php?id=29612&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=29612&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=29612&r=float