Fizzbuzz function in PHP
Some things I would look for on an interview question such as this:


Is the coder handling bad input cases?  This is something you are not really doing now. What if non-integer values are passed for parameters?  What if values are not > 0?  Oftentimes in interview scenarios like this, I at least want to see the coder acknowledge (even if with a "todo" kind of comment) that validations need to take place.  If I was the one writing this code in the interview, I would probably ask the interviewer if they want you to write the validation code or just get to the heart of the algorithm.  Regardless of their answer, at least they understand that you acknowledge these edge cases.  If you are doing this as an off-line coding test for an interview than I would for sure add in the validation so they don't think you missed this.
I would personally like to see more exact and meaningful comparisons rather than just vaguely truthy/falsey comparison.


Example:

// instead of
if(!($i % $fizz)){    
// something like this
if($i % $fizz === 0){

// instead of
if(!$output[$i]){   
// do this
if(empty($output[$i])) {


To me, the suggested replacement examples are more clear in intent.  Also, I would be worried about developers that make a habit of loose or unclear comparisons as this could be indicative of someone who is writing error-prone code.


The comment //If I ignore warnings, this isn't needed. is really bothersome.  Why would you ignore warnings?  I think your initialization of this array key to an empty string makes sense, specifically in light of you wanting to check it after the moduli checks to see if it is still an empty string.  Don't apologize for writing code that behaves properly.