Usually various kinds of actions try to close internal errors. I will give a primitive example, so that the essence of the question is clearer.
$rand = rand(0, 1); if ($rand == 1) $arr = ['a', 'b', 'c']; printElements($arr); function printElements(array $array) { foreach ($array as $value) echo "$value<br/>"; } In this case, if $rand is 1 , the script will run without errors. If 0 , the user in the browser will see something in the spirit
Fatal error : Uncaught TypeError: Argument 1 passed to printElements (), it is called inpath/path/to/my/project/dir/index.php on line 5 and defined in / path / to / my / project / dir / index.php: 12 Stack trace: # 0 /path/to/my/project/dir/index.php(5): printElements (NULL) # 1 {main} thrown in / path / to / my / project / dir / index.php on line 12.
Now he knows the absolute path to the file, its name, the name of the class (if any) and the method in which the exception occurred.
Such errors are caught with the help of the normal try...catch code , this is clear.
Actually, the question. Do I need to hard to catch errors that give absolute paths to files? What can this threaten in terms of security? How critical is it and how can intruders take advantage of it?