cmath vs math.h (And similar c-prefixed vs .h extension headers)

I’ve seen some information about differences between things like iostream vs iostream.h. [iostream.h] is not a standard header. it is not an example of the issue you’re raising. [cmath] defines symbols in the std namespace, and may also define symbols in the global namespace. [math.h] defines symbols in the global namespace, and may also define symbols in … Read more

Difference between require, include, require_once and include_once?

There are require and include_once as well. So your question should be… When should I use require vs. include? When should I use require_once vs. require The answer to 1 is described here. The require() function is identical to include(), except that it handles errors differently. If an error occurs, the include() function generates a warning, but the script will continue execution. The require() generates a … Read more

“Fatal error: Cannot redeclare function”

This errors says your function is already defined ; which can mean : you have the same function defined in two files or you have the same function defined in two places in the same file or the file in which your function is defined is included two times (so, it seems the function is … Read more