{"action":"created","issue":{"url":"https://api.github.com/repos/padraic/mockery/issues/533","repository_url":"https://api.github.com/repos/padraic/mockery","labels_url":"https://api.github.com/repos/padraic/mockery/issues/533/labels{/name}","comments_url":"https://api.github.com/repos/padraic/mockery/issues/533/comments","events_url":"https://api.github.com/repos/padraic/mockery/issues/533/events","html_url":"https://github.com/padraic/mockery/issues/533","id":126848162,"number":533,"title":"PHP 7: Mocking class with __toString() with return typehint causes Fatal error","user":{"login":"simara-svatopluk","id":1669982,"avatar_url":"https://avatars.githubusercontent.com/u/1669982?v=3","gravatar_id":"","url":"https://api.github.com/users/simara-svatopluk","html_url":"https://github.com/simara-svatopluk","followers_url":"https://api.github.com/users/simara-svatopluk/followers","following_url":"https://api.github.com/users/simara-svatopluk/following{/other_user}","gists_url":"https://api.github.com/users/simara-svatopluk/gists{/gist_id}","starred_url":"https://api.github.com/users/simara-svatopluk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simara-svatopluk/subscriptions","organizations_url":"https://api.github.com/users/simara-svatopluk/orgs","repos_url":"https://api.github.com/users/simara-svatopluk/repos","events_url":"https://api.github.com/users/simara-svatopluk/events{/privacy}","received_events_url":"https://api.github.com/users/simara-svatopluk/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-01-15T10:36:50Z","updated_at":"2016-04-29T06:04:15Z","closed_at":"2016-04-28T22:56:30Z","body":"When I try to mock a class:\r\n\r\n```php\r\nclass Printable {\r\n\tpublic function __toString() : string {\r\n\t\treturn \"\";\r\n\t}\r\n}\r\n\r\n$mock = Mockery::mock(Printable::class);\r\n```\r\n\r\nMockery fails:\r\n`Fatal error: Declaration of Mockery_0_Printable::__toString() must be compatible with Printable::__toString(): string in /var/www/uni-core.l/vendor/mockery/mockery/library/Mockery/Loader/EvalLoader.php(16) : eval()'d code on line 25`\r\n\r\nOf course, it's because of the return typehint. Temporary solution is removing ` : string`, and everything works well."},"comment":{"url":"https://api.github.com/repos/padraic/mockery/issues/comments/215633456","html_url":"https://github.com/padraic/mockery/issues/533#issuecomment-215633456","issue_url":"https://api.github.com/repos/padraic/mockery/issues/533","id":215633456,"user":{"login":"simara-svatopluk","id":1669982,"avatar_url":"https://avatars.githubusercontent.com/u/1669982?v=3","gravatar_id":"","url":"https://api.github.com/users/simara-svatopluk","html_url":"https://github.com/simara-svatopluk","followers_url":"https://api.github.com/users/simara-svatopluk/followers","following_url":"https://api.github.com/users/simara-svatopluk/following{/other_user}","gists_url":"https://api.github.com/users/simara-svatopluk/gists{/gist_id}","starred_url":"https://api.github.com/users/simara-svatopluk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simara-svatopluk/subscriptions","organizations_url":"https://api.github.com/users/simara-svatopluk/orgs","repos_url":"https://api.github.com/users/simara-svatopluk/repos","events_url":"https://api.github.com/users/simara-svatopluk/events{/privacy}","received_events_url":"https://api.github.com/users/simara-svatopluk/received_events","type":"User","site_admin":false},"created_at":"2016-04-29T06:04:15Z","updated_at":"2016-04-29T06:04:15Z","body":"Thank You a lot :+1: "}}