I call this an imaginary error, because the code that causes is never run, and it does not report an error, but the functionality breaks.
I'm developing a PHP framework. I have a debugger that writes lines to the a file throughout the execution of the framework. I noticed today that the debugger was cutting off midway through, and didn't start until the very end. (And fwrite was returning the normal int throughout) So I did my usual debugging course, and found the line of code that was causing it. It was this:
$this->error->trigger('noRoute','URL Has No Matching Route',array('URL'=>$url),'404');
The odd thing about this was that it was not being executed, yet still causing the debugger to stop. It was within an if statement that in most circumstances would not return true. I looked into the trigger() function, and found the code causing the error:
exit;
Yep, thats what was causing the problem. Although that particular line of code was not being executed, it was still halting the debugger. (die() yielded the same results) I commented that line, and other various exit; statements throughout the framework did the same thing.
This is the weirdest bug I have ever encountered. Is there a way to fix this? Is this a known bug?