The example shown in the README: Phockito::when($stub)->Foo(argOfTypeThat('B', is(equalTo($b))))->return('Zap'); Does not work. Simply missing return statement. Fixed. Added test case. Pull request #39. I'm a github noob ;-)