I have looked far and wide but haven't been able to find anything related to this specific situation, I am a backend developer and always write (something similar to):
if (!defined("something")) define("something", true);
instead of just
define("something"; true);
The second snippet will trigger a Notice if the file is included more than once. Similar situation with array indexes:
$data = array();
echo $data["does not exist"];
will trigger a notice, so my preferred way is to:
$data = array();
if (isset($data["does not exist"]) echo $data["does not exist"];
else echo "Missing info";
PHP has the ability to suppress these messages but I keep them enabled because I consider these checks good practice, but I lack the evidence to prove that they are needed and recently a coworker argued that there is no effect in coding without the checks.
Are you aware of any security implication in not writing the checks? or am I perhaps being paranoid and disabling the notices is acceptable?
PS: Not sure if this question is more suitable for StackOverflow but feel free to let me know and I'll try to move it.