{"action":"created","issue":{"url":"https://api.github.com/repos/phan/phan/issues/403","repository_url":"https://api.github.com/repos/phan/phan","labels_url":"https://api.github.com/repos/phan/phan/issues/403/labels{/name}","comments_url":"https://api.github.com/repos/phan/phan/issues/403/comments","events_url":"https://api.github.com/repos/phan/phan/issues/403/events","html_url":"https://github.com/phan/phan/issues/403","id":190361041,"number":403,"title":"Phan should be able to catch bad null casts","user":{"login":"adrienp","id":1620949,"avatar_url":"https://avatars2.githubusercontent.com/u/1620949?v=4","gravatar_id":"","url":"https://api.github.com/users/adrienp","html_url":"https://github.com/adrienp","followers_url":"https://api.github.com/users/adrienp/followers","following_url":"https://api.github.com/users/adrienp/following{/other_user}","gists_url":"https://api.github.com/users/adrienp/gists{/gist_id}","starred_url":"https://api.github.com/users/adrienp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adrienp/subscriptions","organizations_url":"https://api.github.com/users/adrienp/orgs","repos_url":"https://api.github.com/users/adrienp/repos","events_url":"https://api.github.com/users/adrienp/events{/privacy}","received_events_url":"https://api.github.com/users/adrienp/received_events","type":"User","site_admin":false},"labels":[{"id":276522258,"url":"https://api.github.com/repos/phan/phan/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-11-18T16:26:29Z","updated_at":"2018-03-12T05:58:59Z","closed_at":null,"author_association":"NONE","body":"Currently with `null_casts_as_any_type` on, phan won't catch this error:\r\n\r\n```php\r\nfunction do_something(array $arr) {\r\n    print_r($arr);\r\n}\r\n\r\ndo_something(null);\r\n```\r\n\r\nAlthough PHP7 will throw:\r\n\r\n```\r\nFatal error: Uncaught TypeError: Argument 1 passed to do_something() must be of the type array, null given\r\n```\r\n\r\nIt seems like we should be able to differentiate between a \"safe-ish\" casting of `null`, and a non-safe casting of `null` like this one."},"comment":{"url":"https://api.github.com/repos/phan/phan/issues/comments/372201492","html_url":"https://github.com/phan/phan/issues/403#issuecomment-372201492","issue_url":"https://api.github.com/repos/phan/phan/issues/403","id":372201492,"user":{"login":"TysonAndre","id":1904430,"avatar_url":"https://avatars2.githubusercontent.com/u/1904430?v=4","gravatar_id":"","url":"https://api.github.com/users/TysonAndre","html_url":"https://github.com/TysonAndre","followers_url":"https://api.github.com/users/TysonAndre/followers","following_url":"https://api.github.com/users/TysonAndre/following{/other_user}","gists_url":"https://api.github.com/users/TysonAndre/gists{/gist_id}","starred_url":"https://api.github.com/users/TysonAndre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TysonAndre/subscriptions","organizations_url":"https://api.github.com/users/TysonAndre/orgs","repos_url":"https://api.github.com/users/TysonAndre/repos","events_url":"https://api.github.com/users/TysonAndre/events{/privacy}","received_events_url":"https://api.github.com/users/TysonAndre/received_events","type":"User","site_admin":false},"created_at":"2018-03-12T05:58:59Z","updated_at":"2018-03-12T05:58:59Z","author_association":"COLLABORATOR","body":"Phan tracks phpdoc types and real types separately now.\r\n\r\nRelated to https://github.com/phan/phan/issues/1549 as a specific example."}}
{"actor":{"display_login":"TysonAndre"}}