Warning : Every time you discover a new bug, you should add a regression test to make sure it does not appear again.
Hint: Always make sure new code follows the PSR-2 standard for PHP. Use codesniffer and messdetector to catch common bugs and style fixes in your code.