Fixes #311 Due to a memory handling issue in PHP core Mocks might cause PHP to error out when called in a destructor.
Merge pull request #314 from realityking/master

Fixes #311 PHP fatal error