{"action":"opened","issue":{"url":"https://api.github.com/repos/dg/composer-backslasher/issues/5","repository_url":"https://api.github.com/repos/dg/composer-backslasher","labels_url":"https://api.github.com/repos/dg/composer-backslasher/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/dg/composer-backslasher/issues/5/comments","events_url":"https://api.github.com/repos/dg/composer-backslasher/issues/5/events","html_url":"https://github.com/dg/composer-backslasher/issues/5","id":342337167,"node_id":"MDU6SXNzdWUzNDIzMzcxNjc=","number":5,"title":"Local function overriding the one from PHP API","user":{"login":"Trejjam","id":3594540,"node_id":"MDQ6VXNlcjM1OTQ1NDA=","avatar_url":"https://avatars2.githubusercontent.com/u/3594540?v=4","gravatar_id":"","url":"https://api.github.com/users/Trejjam","html_url":"https://github.com/Trejjam","followers_url":"https://api.github.com/users/Trejjam/followers","following_url":"https://api.github.com/users/Trejjam/following{/other_user}","gists_url":"https://api.github.com/users/Trejjam/gists{/gist_id}","starred_url":"https://api.github.com/users/Trejjam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Trejjam/subscriptions","organizations_url":"https://api.github.com/users/Trejjam/orgs","repos_url":"https://api.github.com/users/Trejjam/repos","events_url":"https://api.github.com/users/Trejjam/events{/privacy}","received_events_url":"https://api.github.com/users/Trejjam/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-07-18T13:49:57Z","updated_at":"2018-07-18T13:49:57Z","closed_at":null,"author_association":"NONE","body":"- bug report? yes\r\n- feature request? yes\r\n\r\n### Description\r\nThis tool is incompatible with package https://github.com/guzzle/promises which override PHP function `each` by own version (and maybe some other).\r\n\r\n### Steps To Reproduce\r\nUse library with following content:\r\n```php\r\n<?php\r\nnamespace A;\r\n\r\nfunction settle($promises)\r\n{\r\n    $results = [];\r\n    return each(\r\n        $promises,\r\n        function () {},\r\n        function () {}\r\n    )->then(function () use (&$results) {\r\n        ksort($results);\r\n        return $results;\r\n    });\r\n}\r\n\r\nfunction each(\r\n    $iterable,\r\n    callable $onFulfilled = null,\r\n    callable $onRejected = null\r\n) {\r\n    return 'baz';\r\n}\r\n```\r\n\r\n### Expected result after processed by this tool\r\n```php\r\n<?php\r\nnamespace A;\r\n\r\nfunction settle($promises)\r\n{\r\n    $results = [];\r\n    return each(\r\n        $promises,\r\n        function () {},\r\n        function () {}\r\n    )->then(function () use (&$results) {\r\n        \\ksort($results);\r\n        return $results;\r\n    });\r\n}\r\n\r\nfunction each(\r\n    $iterable,\r\n    callable $onFulfilled = null,\r\n    callable $onRejected = null\r\n) {\r\n    return 'baz';\r\n}\r\n```\r\n\r\n### What is produced instead\r\n```php\r\n<?php\r\nnamespace A;\r\n\r\nfunction settle($promises)\r\n{\r\n    $results = [];\r\n    return \\each( // notice this back slash, targeting global method instead local one\r\n        $promises,\r\n        function () {},\r\n        function () {}\r\n    )->then(function () use (&$results) {\r\n        \\ksort($results);\r\n        return $results;\r\n    });\r\n}\r\n\r\nfunction each(\r\n    $iterable,\r\n    callable $onFulfilled = null,\r\n    callable $onRejected = null\r\n) {\r\n    return 'baz';\r\n}\r\n```"}}
{"actor":{"display_login":"Trejjam"}}