Fixes #239, test character before function keyword

Infront of the function keyword, there may only be
* a spacing character/newline
* opening bracket (array, function-param)
* comma (function-param)
* equal (var assign)
* opening square bracket (array php5.4)
* nothing (start of file)

Added a data set for the bug and change regex