ginfinity
03-19-2009, 04:31 AM
Hello,
I am an experienced C++ programmer but am new to PHP. I would like to develop for PHP5 but have some questions.
Question 1)
I need to know the default behavior of PHP5 functions when an error occurs. For example, in PHP4 (I believe) functions return FALSE or some other error code. In PHP5 it is my understanding that functions throw an Exception on error. So ... my question is ... do ALL PHP5 functions throw errors when an error occurs, or only certain ones, or how exactly does that work?
Question 2)
If only some PHP5 functions throw (and not all), where do you find documentation outlining this (which ones do and which ones don't).
I ask this because the only documentation I can find on PHP functions on the web are not version specific in any way. They say ... "returns FALSE" or some other error code but do not mention anywhere if they throw Exceptions. It would simplify things a LOT to know if ALL PHP5 functions that CAN error throw errors, or some other way to know PHP5s behavior on erring functions.
Thank you for your help.
Jeremy
I am an experienced C++ programmer but am new to PHP. I would like to develop for PHP5 but have some questions.
Question 1)
I need to know the default behavior of PHP5 functions when an error occurs. For example, in PHP4 (I believe) functions return FALSE or some other error code. In PHP5 it is my understanding that functions throw an Exception on error. So ... my question is ... do ALL PHP5 functions throw errors when an error occurs, or only certain ones, or how exactly does that work?
Question 2)
If only some PHP5 functions throw (and not all), where do you find documentation outlining this (which ones do and which ones don't).
I ask this because the only documentation I can find on PHP functions on the web are not version specific in any way. They say ... "returns FALSE" or some other error code but do not mention anywhere if they throw Exceptions. It would simplify things a LOT to know if ALL PHP5 functions that CAN error throw errors, or some other way to know PHP5s behavior on erring functions.
Thank you for your help.
Jeremy