Instead of using $stackPlus, could you not just look for `T_OPEN_CURLY_BRACKET` and then look at the token that precedes it?