padraic/mockery — pull request #330 by lytc (2014-05-14 01:50:43+00:00)
Title: Expectation::matchArg use try/catch exception instead of @ operator

If user defined custom error handler and fallback to ErrorException, it throw an exception: "ErrorException: preg_match(): Delimiter must not be alphanumeric or backslash" when call @preg_match with invalid regex pattern to matches argument.

To prevent it, we should fallback error to exception, try/catch preg_match call and restore error handler after that.

I found there are some issues reported with xdebug.scream = On related to that problem. It will be fix that problem too!
https://github.com/padraic/mockery/issues/160
https://github.com/padraic/mockery/issues/302