Does anyone know why my require_once () or die(); is not working. It\'s always shown the Fatal error instead of the error message that I key in into the die(). See below for
When evaluating:
require_once ('abc.php') or die("oops");
PHP evaluates 'OR die("oops")' first for some reason. to force PHP to evaluate the "require_once ('abc.php')" encolse it in brackets.
(require_once ('abc.php')) OR die("oops");
However, if "require" fails, PHP stops processing so use "include" instead (see https://stackoverflow.com/a/2418514/1704651). Also, the @ symbol before include_once supresses the error message from MySQL so only the "oops" is output.
(@include_once ('abc.php')) OR die("oops");
Works as expected.
Source: My own frustration and https://bugs.php.net/bug.php?id=22342