By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,216 Members | 1,013 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,216 IT Pros & Developers. It's quick & easy.

move fails, php dies

P: n/a
I was doing this:

@move('non_existant_file',...

and that killed php silently.

Why is that fatal, and does the "@" merely suppress reporting errors?

Sometimes I don't care if a move or delete does not work, as was the
case here, but I do care if the script dies. Try catch failed silently also.

I've fixed that by checking for the file first, but I wonder what
else I have to look out for. Is there a list of fatal errors?

Jeff
Sep 10 '08 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Jeff wrote:
I was doing this:

@move('non_existant_file',...

and that killed php silently.

Why is that fatal, and does the "@" merely suppress reporting errors?

Sometimes I don't care if a move or delete does not work, as was the
case here, but I do care if the script dies. Try catch failed silently
also.

I've fixed that by checking for the file first, but I wonder what else
I have to look out for. Is there a list of fatal errors?

Jeff
What is move()? It's not a PHP function.

Also - '@' does not change the actions after an error - it just
suppresses the reporting of the error. A fatal error is still a fatal
error. And a fatal PHP error cannot be caught with try/catch.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Sep 10 '08 #2

P: n/a
Jerry Stuckle wrote:
Jeff wrote:
>I was doing this:

@move('non_existant_file',...

and that killed php silently.

Why is that fatal, and does the "@" merely suppress reporting errors?

Sometimes I don't care if a move or delete does not work, as was the
case here, but I do care if the script dies. Try catch failed silently
also.

I've fixed that by checking for the file first, but I wonder what
else I have to look out for. Is there a list of fatal errors?

Jeff

What is move()? It's not a PHP function.
Well, that explains that!

I intended rename, since my php vocabulary is still developing that
snuck in somehow. I keep the php manual open because I'm always looking
something up.

Jeff
>
Also - '@' does not change the actions after an error - it just
suppresses the reporting of the error. A fatal error is still a fatal
error. And a fatal PHP error cannot be caught with try/catch.
Sep 10 '08 #3

P: n/a
Jeff wrote:
Jerry Stuckle wrote:
>Jeff wrote:
>>I was doing this:

@move('non_existant_file',...

and that killed php silently.

Why is that fatal, and does the "@" merely suppress reporting errors?

Sometimes I don't care if a move or delete does not work, as was
the case here, but I do care if the script dies. Try catch failed
silently also.

I've fixed that by checking for the file first, but I wonder what
else I have to look out for. Is there a list of fatal errors?

Jeff

What is move()? It's not a PHP function.

Well, that explains that!

I intended rename, since my php vocabulary is still developing that
snuck in somehow. I keep the php manual open because I'm always looking
something up.

Jeff
>>
Also - '@' does not change the actions after an error - it just
suppresses the reporting of the error. A fatal error is still a fatal
error. And a fatal PHP error cannot be caught with try/catch.
In your development system, your php.ini file should always have:

display_errors=on
error_reporting=E_ALL

(in your production system you should always have display_errors=off).

And in general, don't use the '@' operator. It causes more problems
(like this) that it solves. There are a few exceptions - but very few
(mysql functions are NOT one of them!).

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Sep 10 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.