I made a huge mistake by mixing result with results and it took me around 4 hours to finally find the bug.
So here is the question, in PHP, is it possible that I can enforce PHP to report errors if I use an undefined/uninitialized variable.
thank you
it already does report an error. something like this:
maybe you didn't go specific enough. but you should try
error_reporting(-1);
as as if enforces the php to show some recomendations. a piece from the php manual about E_STRICT errors:just remember that
error_reporting(-1);
shows more errors thanerror_reporting(E_ALL);
becauseE_STRICT
errors are not included in theE_ALL
constraint.Set error reporting to
E_ALL
and ensure thatdisplay_errors
inphp.ini
is on.php.ini
PHP code
The default setting you have right now probably excludes notices, the kind of errors PHP raises on uninitialized variables, which could be something like this:
In a development environment I prefer using
error_reporting(-1)
. Which reports all PHP errors.yes, use
error_reporting()
and set it toE_ALL
, like this:Set error reporting to report all errors. Either in php.ini or at runtime using
error_reporting(E_ALL)