Can I get PHP to throw an error when I try to define a function that has already been defined?
<p>I run into this problem periodically, and I'm trying to figure out if it's a configuration issue or a peculiarity with PHP.</p>

<p>Basically, there will be a function foo() defined somewhere in my code, and then elsewhere I will accidentally define a function again with the same name foo(). I would expect an error of some kind to be thrown, e.g. "Fatal Error: Function already defined line 234, bar.php blah blah".</p>

<p>But I get nothing. I just get a blank screen. Debugging can take an eternity as I try to pinpoint exactly where the function is being accidentally redefined, without help from an error message.</p>

<p>My config settings for reporting errors are set to E_ALL, and I see all other kinds of errors without a hitch.</p>

<p>Any insights? Is there anything I can do to cause PHP to report these errors (so that I can either rename the offending function or wrap it in an if function_exists() clause)?</p>

<p>Edit: To be clear, I understand the many strategies to avoid namespace collisions in PHP. I'm talking about instances where for whatever reason I <em>accidentally</em> name a function a name that already exists during development (or for example I import a file where a function has already been defined). I would expect an error message when this occurs, which would help me debug, but I do not get one.</p>
