{"action":"created","issue":{"url":"https://api.github.com/repos/zencart/zencart/issues/1377","repository_url":"https://api.github.com/repos/zencart/zencart","labels_url":"https://api.github.com/repos/zencart/zencart/issues/1377/labels{/name}","comments_url":"https://api.github.com/repos/zencart/zencart/issues/1377/comments","events_url":"https://api.github.com/repos/zencart/zencart/issues/1377/events","html_url":"https://github.com/zencart/zencart/pull/1377","id":204410789,"number":1377,"title":"Refactor each() to foreach() for compatibility with PHP 7.2","user":{"login":"drbyte","id":404472,"avatar_url":"https://avatars.githubusercontent.com/u/404472?v=3","gravatar_id":"","url":"https://api.github.com/users/drbyte","html_url":"https://github.com/drbyte","followers_url":"https://api.github.com/users/drbyte/followers","following_url":"https://api.github.com/users/drbyte/following{/other_user}","gists_url":"https://api.github.com/users/drbyte/gists{/gist_id}","starred_url":"https://api.github.com/users/drbyte/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drbyte/subscriptions","organizations_url":"https://api.github.com/users/drbyte/orgs","repos_url":"https://api.github.com/users/drbyte/repos","events_url":"https://api.github.com/users/drbyte/events{/privacy}","received_events_url":"https://api.github.com/users/drbyte/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-01-31T20:12:33Z","updated_at":"2017-02-01T18:56:06Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/zencart/zencart/pulls/1377","html_url":"https://github.com/zencart/zencart/pull/1377","diff_url":"https://github.com/zencart/zencart/pull/1377.diff","patch_url":"https://github.com/zencart/zencart/pull/1377.patch"},"body":"An RFC for PHP 7.2 has been voted on for inclusion in PHP 7.2.  It proposes to deprecate the `each()` function for PHP 7.2 and removes it in 8.0.\r\n\r\nThe `each()` function is exponentially slower and wastes resources vs `foreach()`, so we're refactoring it now whether PHP 7.2 finally does adopt it or not.\r\n\r\nThings to note when refactoring: \r\n1. `foreach()` doesn't need a `reset()` to be called before it runs, so those can be removed.\r\n2. There are 3 syntax formats, depending on how the parameters are presented in the `list()` call:\r\n\r\na) `while(list($key, $value) = each($foo))`\r\nThis becomes `foreach($foo as $key => $value)`\r\n\r\nb) `while(list(, $value) = each($foo))`\r\nThis becomes `foreach($foo as $value)`\r\n\r\nc) `while(list($key, ) = each($foo))`\r\nThis becomes `foreach($foo as $key => $value)`\r\n"},"comment":{"url":"https://api.github.com/repos/zencart/zencart/issues/comments/276746701","html_url":"https://github.com/zencart/zencart/pull/1377#issuecomment-276746701","issue_url":"https://api.github.com/repos/zencart/zencart/issues/1377","id":276746701,"user":{"login":"ajeh","id":1992427,"avatar_url":"https://avatars.githubusercontent.com/u/1992427?v=3","gravatar_id":"","url":"https://api.github.com/users/ajeh","html_url":"https://github.com/ajeh","followers_url":"https://api.github.com/users/ajeh/followers","following_url":"https://api.github.com/users/ajeh/following{/other_user}","gists_url":"https://api.github.com/users/ajeh/gists{/gist_id}","starred_url":"https://api.github.com/users/ajeh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ajeh/subscriptions","organizations_url":"https://api.github.com/users/ajeh/orgs","repos_url":"https://api.github.com/users/ajeh/repos","events_url":"https://api.github.com/users/ajeh/events{/privacy}","received_events_url":"https://api.github.com/users/ajeh/received_events","type":"User","site_admin":false},"created_at":"2017-02-01T18:56:06Z","updated_at":"2017-02-01T18:56:06Z","body":":+1: "}}
{"actor":{"display_login":"ajeh"}}