#19329 [Fbk->Opn]: suppressing error messsages with '@' fails

From: Date: Tue, 10 Sep 2002 23:08:00 +0000
Subject: #19329 [Fbk->Opn]: suppressing error messsages with '@' fails
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-18988@lists.php.net to get a copy of this message
ID: 19329 User updated by: soletan@toxa.de Reported By: soletan@toxa.de -Status: Feedback +Status: Open Bug Type: Filesystem function related Operating System: Linux 2.4.18 PHP Version: 4.2.3 New Comment: Some script example ... ------------------ // if ( ( @in_array( "DOM", $b["type"] ) ) && file_exists( "../lib/ua-dep/layout-draw-css.php4" ) ) if ( ( @in_array( "DOM", $b["type"] ) ) && ( $handle = @fopen( "../lib/ua-dep/layout-draw-css.php4", "r" ) ) ) include( "../lib/ua-dep/layout-draw-css.php4" ); // else if ( file_exists( "../lib/ua-dep/layout-draw-tables.php4" ) ) else if ( ( $handle = @fopen( "../lib/ua-dep/layout-draw-tables.php4", "r" ) ) ) include( "../lib/ua-dep/layout-draw-tables.php4" ); else ... ------------------ I use this branching to serve the same content in different ways depending on the client's browser. It works great for the second uncommented "if", as soon as I comment out the first one. Without that I have to place some script in given directory with correct name to prevent the error message. Well, but apparently I want the snippet to auto-detect, which module fits best and which is available currently. This feature isn't possible. BTW: The second included script exists of course, the first doesn't ... Previous Comments: ------------------------------------------------------------------------ [2002-09-10 09:54:18] sniper@php.net Please provide a short example script.. ------------------------------------------------------------------------ [2002-09-10 04:41:29] soletan@toxa.de Hi, is it right to use '@' before function calls to prevent them from producing error messages??? I'm using Apache 2.0.40 with PHP 4.2.3 and Zend Optimizer 2.0 included. Well, I use it before fopen and get some message, that the file I'm looking for isn't available for reading. After some stress with file_exists I used this to workaround file_exists. To test that problem I prepared to use 4.3.0-dev snapshot 200209082100 which I used now to test this new failure, again. It reports some error message, too. It is just reformed to say the same with other words. ("failed to create stream: ...") ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=19329&edit=1

« previous php.bugs (#18988) next »