{"action":"closed","issue":{"url":"https://api.github.com/repos/Gert-dev/php-integrator-base/issues/156","repository_url":"https://api.github.com/repos/Gert-dev/php-integrator-base","labels_url":"https://api.github.com/repos/Gert-dev/php-integrator-base/issues/156/labels{/name}","comments_url":"https://api.github.com/repos/Gert-dev/php-integrator-base/issues/156/comments","events_url":"https://api.github.com/repos/Gert-dev/php-integrator-base/issues/156/events","html_url":"https://github.com/Gert-dev/php-integrator-base/issues/156","id":153806423,"number":156,"title":"Type deduction with ternary operators.","user":{"login":"Gert-dev","id":6823929,"avatar_url":"https://avatars.githubusercontent.com/u/6823929?v=3","gravatar_id":"","url":"https://api.github.com/users/Gert-dev","html_url":"https://github.com/Gert-dev","followers_url":"https://api.github.com/users/Gert-dev/followers","following_url":"https://api.github.com/users/Gert-dev/following{/other_user}","gists_url":"https://api.github.com/users/Gert-dev/gists{/gist_id}","starred_url":"https://api.github.com/users/Gert-dev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gert-dev/subscriptions","organizations_url":"https://api.github.com/users/Gert-dev/orgs","repos_url":"https://api.github.com/users/Gert-dev/repos","events_url":"https://api.github.com/users/Gert-dev/events{/privacy}","received_events_url":"https://api.github.com/users/Gert-dev/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Gert-dev/php-integrator-base/labels/enhancement","name":"enhancement","color":"009800"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-05-09T15:42:22Z","updated_at":"2016-05-19T18:32:05Z","closed_at":"2016-05-19T18:32:05Z","body":"In some cases, the resulting type of a ternary expression is clear, for example:\r\n\r\n```php\r\n$b = new B();\r\n$a = $b ?: (new B());\r\n```\r\n\r\nWe should evaluate both expressions to detect their resulting type. If they yield the same type, we can use that as the resulting type of the requested variable.\r\n\r\n<bountysource-plugin>\r\n---\r\nWant to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/34054870-type-deduction-with-ternary-operators?utm_campaign=plugin&utm_content=tracker%2F24763063&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F24763063&utm_medium=issues&utm_source=github).\r\n</bountysource-plugin>"}}