{"action":"created","issue":{"url":"https://api.github.com/repos/kalessil/phpinspectionsea/issues/379","repository_url":"https://api.github.com/repos/kalessil/phpinspectionsea","labels_url":"https://api.github.com/repos/kalessil/phpinspectionsea/issues/379/labels{/name}","comments_url":"https://api.github.com/repos/kalessil/phpinspectionsea/issues/379/comments","events_url":"https://api.github.com/repos/kalessil/phpinspectionsea/issues/379/events","html_url":"https://github.com/kalessil/phpinspectionsea/issues/379","id":240535452,"node_id":"MDU6SXNzdWUyNDA1MzU0NTI=","number":379,"title":"Proposal: predict undefined offset errors","user":{"login":"b1rdex","id":312855,"node_id":"MDQ6VXNlcjMxMjg1NQ==","avatar_url":"https://avatars2.githubusercontent.com/u/312855?v=4","gravatar_id":"","url":"https://api.github.com/users/b1rdex","html_url":"https://github.com/b1rdex","followers_url":"https://api.github.com/users/b1rdex/followers","following_url":"https://api.github.com/users/b1rdex/following{/other_user}","gists_url":"https://api.github.com/users/b1rdex/gists{/gist_id}","starred_url":"https://api.github.com/users/b1rdex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/b1rdex/subscriptions","organizations_url":"https://api.github.com/users/b1rdex/orgs","repos_url":"https://api.github.com/users/b1rdex/repos","events_url":"https://api.github.com/users/b1rdex/events{/privacy}","received_events_url":"https://api.github.com/users/b1rdex/received_events","type":"User","site_admin":false},"labels":[{"id":462160561,"node_id":"MDU6TGFiZWw0NjIxNjA1NjE=","url":"https://api.github.com/repos/kalessil/phpinspectionsea/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/kalessil/phpinspectionsea/milestones/12","html_url":"https://github.com/kalessil/phpinspectionsea/milestone/12","labels_url":"https://api.github.com/repos/kalessil/phpinspectionsea/milestones/12/labels","id":2536894,"node_id":"MDk6TWlsZXN0b25lMjUzNjg5NA==","number":12,"title":"Backlog","description":"Priorities for next release after current milestone (still should be filtered).","creator":{"login":"rentalhost","id":421851,"node_id":"MDQ6VXNlcjQyMTg1MQ==","avatar_url":"https://avatars1.githubusercontent.com/u/421851?v=4","gravatar_id":"","url":"https://api.github.com/users/rentalhost","html_url":"https://github.com/rentalhost","followers_url":"https://api.github.com/users/rentalhost/followers","following_url":"https://api.github.com/users/rentalhost/following{/other_user}","gists_url":"https://api.github.com/users/rentalhost/gists{/gist_id}","starred_url":"https://api.github.com/users/rentalhost/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rentalhost/subscriptions","organizations_url":"https://api.github.com/users/rentalhost/orgs","repos_url":"https://api.github.com/users/rentalhost/repos","events_url":"https://api.github.com/users/rentalhost/events{/privacy}","received_events_url":"https://api.github.com/users/rentalhost/received_events","type":"User","site_admin":false},"open_issues":56,"closed_issues":7,"state":"open","created_at":"2017-05-22T23:38:44Z","updated_at":"2018-07-04T19:50:40Z","due_on":null,"closed_at":null},"comments":3,"created_at":"2017-07-05T04:31:21Z","updated_at":"2018-07-05T11:34:40Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"I propose to add warning for unchecked array access as it can produce runtime errors.\r\n\r\nExample:\r\n```php\r\n$a = ['foo' => 'bar', 'baz' => 'foo'];\r\n\r\n$c = 'some key';\r\n$b = $a[$c];\r\n```\r\n\r\nIt'd be great to warn `$a[$c]` place as it can produce offset access error.\r\nExpressions like `$var[$key] ?? null` (or any other expression after `??`) should be ignored.\r\nFlow with `isset` or `array_key_exists` before access should be ignored too.\r\nI'm not sure, but I think that such access to `ArrayAccess` implementors should be ignored too, as behavior is controlled by implementation (silent `null` return or some default value or some exception).\r\n\r\nI think this should be also disabled for exact string/position access like `$var['key']` or `$var[2]`, as it's very common usage for configs."},"comment":{"url":"https://api.github.com/repos/kalessil/phpinspectionsea/issues/comments/402693734","html_url":"https://github.com/kalessil/phpinspectionsea/issues/379#issuecomment-402693734","issue_url":"https://api.github.com/repos/kalessil/phpinspectionsea/issues/379","id":402693734,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMjY5MzczNA==","user":{"login":"stale[bot]","id":26384082,"node_id":"MDM6Qm90MjYzODQwODI=","avatar_url":"https://avatars3.githubusercontent.com/in/1724?v=4","gravatar_id":"","url":"https://api.github.com/users/stale%5Bbot%5D","html_url":"https://github.com/apps/stale","followers_url":"https://api.github.com/users/stale%5Bbot%5D/followers","following_url":"https://api.github.com/users/stale%5Bbot%5D/following{/other_user}","gists_url":"https://api.github.com/users/stale%5Bbot%5D/gists{/gist_id}","starred_url":"https://api.github.com/users/stale%5Bbot%5D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stale%5Bbot%5D/subscriptions","organizations_url":"https://api.github.com/users/stale%5Bbot%5D/orgs","repos_url":"https://api.github.com/users/stale%5Bbot%5D/repos","events_url":"https://api.github.com/users/stale%5Bbot%5D/events{/privacy}","received_events_url":"https://api.github.com/users/stale%5Bbot%5D/received_events","type":"Bot","site_admin":false},"created_at":"2018-07-05T11:34:40Z","updated_at":"2018-07-05T11:34:40Z","author_association":"NONE","body":"Bebo beep, the StaleBot is here. For one year nothing have happened here. It would be great if someone looked into details here within next 21 days when I'll close it.\n"}}
{"actor":{"display_login":"stale"}}