Greetings,
Has anyone ever tried to setup a 'try catch' scenario in PHP4? My reason for asking is:
I have a piece of code (we'll call it: base code) which all other code must go through to access the db. The base code performs some validation and escapes values...because the base code can return false, I need to check for errors every time it is accessed, consquently my code is littered with:
Causing what I would deem as 'code bloat', if it wasn't necessary...So to fix this problem I have been trying to devise a way to mimic the 'try catch' statements of PHP5 in PHP4.
All I need is a way to execute a bunch of statements and check if any return false.
Thanks for any suggestions,
Itshim
Has anyone ever tried to setup a 'try catch' scenario in PHP4? My reason for asking is:
I have a piece of code (we'll call it: base code) which all other code must go through to access the db. The base code performs some validation and escapes values...because the base code can return false, I need to check for errors every time it is accessed, consquently my code is littered with:
Code:
if (!$code->base_call()) {
return false;
}
All I need is a way to execute a bunch of statements and check if any return false.
Thanks for any suggestions,
Itshim