Discussion:
PHP equivalent to VB on error resume next
(too old to reply)
Buzby
2007-07-27 09:42:06 UTC
Permalink
As per the title - is there a VBscript type on error resume next
function in PHP 4.2xx

Any pointer would be hugely appreciated!

Cheers!

Grant
--
Buzby
There's nothing more dangerous than a resourceful idiot
Captain Paralytic
2007-07-27 09:48:46 UTC
Permalink
Post by Buzby
As per the title - is there a VBscript type on error resume next
function in PHP 4.2xx
Any pointer would be hugely appreciated!
Cheers!
Grant
--
Buzby
There's nothing more dangerous than a resourceful idiot
http://www.php.net/manual/en/language.exceptions.php
Rik
2007-07-27 09:54:27 UTC
Permalink
Post by Buzby
As per the title - is there a VBscript type on error resume next
function in PHP 4.2xx
Any pointer would be hugely appreciated!
I'm not familiar with VBscript, but you can control error handling quite
good:

http://www.php.net/set_error_handler

Some relevant passage:
"Also note that it is your responsibility to die() if necessary. If the
error-handler function returns, script execution will continue with the
next statement after the one that caused an error. "

Some limitations (pretty obvious offcourse..):
"The following error types cannot be handled with a user defined function:
E_ERROR, E_PARSE, E_CORE_ERROR, E_CORE_WARNING, E_COMPILE_ERROR,
E_COMPILE_WARNING, and most of E_STRICT raised in the file where
set_error_handler() is called."
http://nl2.php.net/manual/en/ref.errorfunc.php#errorfunc.constants

Then again, fatal is fatal, and ignoring errors is not a very good way to
go in most cases. Some extra checks before actions help out a lot.
--
Rik Wasmus
gosha bine
2007-07-27 10:23:44 UTC
Permalink
Post by Buzby
As per the title - is there a VBscript type on error resume next
function in PHP 4.2xx
Any pointer would be hugely appreciated!
Cheers!
Grant
php's "mute" operator is the same as VB's "on error resume next":


VB:

on error resume next
a = xyz / 0 ' no error


php:

@$a = $xyz / 0; // no error
--
gosha bine

makrell ~ http://www.tagarga.com/blok/makrell
php done right ;) http://code.google.com/p/pihipi
Loading...