I guess it's ok like this. Put `$first = false;` at the end of the block (without else), just like you did in the `if` above.