{"action":"created","comment":{"url":"https://api.github.com/repos/drush-ops/drush/pulls/comments/45049975","id":45049975,"diff_hunk":"@@ -70,14 +70,98 @@ function drush_cli_core_cli() {\n function _drush_core_cli_get_commands() {\n   $commands = drush_get_commands();\n   $ignored_commands = ['help', 'drush-psysh', 'php-eval', 'core-cli', 'php'];\n+  $php_keywords = _drush_core_cli_get_php_keywords();\n \n   foreach ($commands as $name => $config) {\n-    // Ignore some commands that don't make sense inside PsySH, are hidden, or\n-    // are aliases.\n-    if (in_array($name, $ignored_commands) || !empty($config['hidden']) || ($name !== $config['command'])) {\n+    // Ignore some commands that don't make sense inside PsySH, are PHP keywords\n+    // are hidden, or are aliases.\n+    if (in_array($name, $ignored_commands) || in_array($name, $php_keywords) || !empty($config['hidden']) || ($name !== $config['command'])) {\n       unset($commands[$name]);\n     }\n+    else {\n+      // Make sure the command aliases don't contain any PHP keywords.\n+      if (!empty($config['aliases'])) {\n+        $commands[$name]['aliases'] = array_diff($commands[$name]['aliases'], $php_keywords);","path":"commands/core/cli.drush.inc","position":18,"original_position":18,"commit_id":"3dadf08504f26b339cdf1a93ec9925fd1748890f","original_commit_id":"3dadf08504f26b339cdf1a93ec9925fd1748890f","user":{"login":"damiankloip","id":1053891,"avatar_url":"https://avatars.githubusercontent.com/u/1053891?v=3","gravatar_id":"","url":"https://api.github.com/users/damiankloip","html_url":"https://github.com/damiankloip","followers_url":"https://api.github.com/users/damiankloip/followers","following_url":"https://api.github.com/users/damiankloip/following{/other_user}","gists_url":"https://api.github.com/users/damiankloip/gists{/gist_id}","starred_url":"https://api.github.com/users/damiankloip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/damiankloip/subscriptions","organizations_url":"https://api.github.com/users/damiankloip/orgs","repos_url":"https://api.github.com/users/damiankloip/repos","events_url":"https://api.github.com/users/damiankloip/events{/privacy}","received_events_url":"https://api.github.com/users/damiankloip/received_events","type":"User","site_admin":false},"body":"Yes, we could try to get this upstream. Let's keep it here for now though, as we can have this working before the 8.0.0 release, if we wait for upstream, we will likely not.","created_at":"2015-11-17T11:41:36Z","updated_at":"2015-11-17T11:41:36Z","html_url":"https://github.com/drush-ops/drush/pull/1775#discussion_r45049975","pull_request_url":"https://api.github.com/repos/drush-ops/drush/pulls/1775","_links":{"self":{"href":"https://api.github.com/repos/drush-ops/drush/pulls/comments/45049975"},"html":{"href":"https://github.com/drush-ops/drush/pull/1775#discussion_r45049975"},"pull_request":{"href":"https://api.github.com/repos/drush-ops/drush/pulls/1775"}}},"pull_request":{"url":"https://api.github.com/repos/drush-ops/drush/pulls/1775","id":50864109,"html_url":"https://github.com/drush-ops/drush/pull/1775","diff_url":"https://github.com/drush-ops/drush/pull/1775.diff","patch_url":"https://github.com/drush-ops/drush/pull/1775.patch","issue_url":"https://api.github.com/repos/drush-ops/drush/issues/1775","number":1775,"state":"open","locked":false,"title":"Filter command aliases for PHP keywords","user":{"login":"damiankloip","id":1053891,"avatar_url":"https://avatars.githubusercontent.com/u/1053891?v=3","gravatar_id":"","url":"https://api.github.com/users/damiankloip","html_url":"https://github.com/damiankloip","followers_url":"https://api.github.com/users/damiankloip/followers","following_url":"https://api.github.com/users/damiankloip/following{/other_user}","gists_url":"https://api.github.com/users/damiankloip/gists{/gist_id}","starred_url":"https://api.github.com/users/damiankloip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/damiankloip/subscriptions","organizations_url":"https://api.github.com/users/damiankloip/orgs","repos_url":"https://api.github.com/users/damiankloip/repos","events_url":"https://api.github.com/users/damiankloip/events{/privacy}","received_events_url":"https://api.github.com/users/damiankloip/received_events","type":"User","site_admin":false},"body":"I was testing out something for one of the PsySH PRs and we have a problem with aliases. There is a high chance one of them could conflict with a PHP keyword. E.g. `if` is an alias of `image-flush` this means we can't eval any php code starting with if :)\r\n\r\nMaybe we should check commands too to be safe?\r\n\r\nNeeds a bit of tidy, just trying to post ASAP before my laptop dies (on 2% atm).","created_at":"2015-11-16T20:51:58Z","updated_at":"2015-11-17T11:41:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f7b6d33f50431cce83d635f66f77aca4f239e1fc","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/drush-ops/drush/pulls/1775/commits","review_comments_url":"https://api.github.com/repos/drush-ops/drush/pulls/1775/comments","review_comment_url":"https://api.github.com/repos/drush-ops/drush/pulls/comments{/number}","comments_url":"https://api.github.com/repos/drush-ops/drush/issues/1775/comments","statuses_url":"https://api.github.com/repos/drush-ops/drush/statuses/3dadf08504f26b339cdf1a93ec9925fd1748890f","head":{"label":"damiankloip:psysh-keywords","ref":"psysh-keywords","sha":"3dadf08504f26b339cdf1a93ec9925fd1748890f","user":{"login":"damiankloip","id":1053891,"avatar_url":"https://avatars.githubusercontent.com/u/1053891?v=3","gravatar_id":"","url":"https://api.github.com/users/damiankloip","html_url":"https://github.com/damiankloip","followers_url":"https://api.github.com/users/damiankloip/followers","following_url":"https://api.github.com/users/damiankloip/following{/other_user}","gists_url":"https://api.github.com/users/damiankloip/gists{/gist_id}","starred_url":"https://api.github.com/users/damiankloip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/damiankloip/subscriptions","organizations_url":"https://api.github.com/users/damiankloip/orgs","repos_url":"https://api.github.com/users/damiankloip/repos","events_url":"https://api.github.com/users/damiankloip/events{/privacy}","received_events_url":"https://api.github.com/users/damiankloip/received_events","type":"User","site_admin":false},"repo":{"id":12485360,"name":"drush","full_name":"damiankloip/drush","owner":{"login":"damiankloip","id":1053891,"avatar_url":"https://avatars.githubusercontent.com/u/1053891?v=3","gravatar_id":"","url":"https://api.github.com/users/damiankloip","html_url":"https://github.com/damiankloip","followers_url":"https://api.github.com/users/damiankloip/followers","following_url":"https://api.github.com/users/damiankloip/following{/other_user}","gists_url":"https://api.github.com/users/damiankloip/gists{/gist_id}","starred_url":"https://api.github.com/users/damiankloip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/damiankloip/subscriptions","organizations_url":"https://api.github.com/users/damiankloip/orgs","repos_url":"https://api.github.com/users/damiankloip/repos","events_url":"https://api.github.com/users/damiankloip/events{/privacy}","received_events_url":"https://api.github.com/users/damiankloip/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/damiankloip/drush","description":"Drush is a command line shell and scripting interface for Drupal, a veritable Swiss Army knife designed to make life easier for those who spend hours working hours hacking away at the command prompt.","fork":true,"url":"https://api.github.com/repos/damiankloip/drush","forks_url":"https://api.github.com/repos/damiankloip/drush/forks","keys_url":"https://api.github.com/repos/damiankloip/drush/keys{/key_id}","collaborators_url":"https://api.github.com/repos/damiankloip/drush/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/damiankloip/drush/teams","hooks_url":"https://api.github.com/repos/damiankloip/drush/hooks","issue_events_url":"https://api.github.com/repos/damiankloip/drush/issues/events{/number}","events_url":"https://api.github.com/repos/damiankloip/drush/events","assignees_url":"https://api.github.com/repos/damiankloip/drush/assignees{/user}","branches_url":"https://api.github.com/repos/damiankloip/drush/branches{/branch}","tags_url":"https://api.github.com/repos/damiankloip/drush/tags","blobs_url":"https://api.github.com/repos/damiankloip/drush/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/damiankloip/drush/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/damiankloip/drush/git/refs{/sha}","trees_url":"https://api.github.com/repos/damiankloip/drush/git/trees{/sha}","statuses_url":"https://api.github.com/repos/damiankloip/drush/statuses/{sha}","languages_url":"https://api.github.com/repos/damiankloip/drush/languages","stargazers_url":"https://api.github.com/repos/damiankloip/drush/stargazers","contributors_url":"https://api.github.com/repos/damiankloip/drush/contributors","subscribers_url":"https://api.github.com/repos/damiankloip/drush/subscribers","subscription_url":"https://api.github.com/repos/damiankloip/drush/subscription","commits_url":"https://api.github.com/repos/damiankloip/drush/commits{/sha}","git_commits_url":"https://api.github.com/repos/damiankloip/drush/git/commits{/sha}","comments_url":"https://api.github.com/repos/damiankloip/drush/comments{/number}","issue_comment_url":"https://api.github.com/repos/damiankloip/drush/issues/comments{/number}","contents_url":"https://api.github.com/repos/damiankloip/drush/contents/{+path}","compare_url":"https://api.github.com/repos/damiankloip/drush/compare/{base}...{head}","merges_url":"https://api.github.com/repos/damiankloip/drush/merges","archive_url":"https://api.github.com/repos/damiankloip/drush/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/damiankloip/drush/downloads","issues_url":"https://api.github.com/repos/damiankloip/drush/issues{/number}","pulls_url":"https://api.github.com/repos/damiankloip/drush/pulls{/number}","milestones_url":"https://api.github.com/repos/damiankloip/drush/milestones{/number}","notifications_url":"https://api.github.com/repos/damiankloip/drush/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/damiankloip/drush/labels{/name}","releases_url":"https://api.github.com/repos/damiankloip/drush/releases{/id}","created_at":"2013-08-30T11:58:52Z","updated_at":"2015-01-16T08:28:38Z","pushed_at":"2015-11-17T10:18:11Z","git_url":"git://github.com/damiankloip/drush.git","ssh_url":"git@github.com:damiankloip/drush.git","clone_url":"https://github.com/damiankloip/drush.git","svn_url":"https://github.com/damiankloip/drush","homepage":"http://drupal.org/project/drush","size":11873,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"drush-ops:master","ref":"master","sha":"880d6d40cebf832d5d987e268602e228ec97c76d","user":{"login":"drush-ops","id":931201,"avatar_url":"https://avatars.githubusercontent.com/u/931201?v=3","gravatar_id":"","url":"https://api.github.com/users/drush-ops","html_url":"https://github.com/drush-ops","followers_url":"https://api.github.com/users/drush-ops/followers","following_url":"https://api.github.com/users/drush-ops/following{/other_user}","gists_url":"https://api.github.com/users/drush-ops/gists{/gist_id}","starred_url":"https://api.github.com/users/drush-ops/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drush-ops/subscriptions","organizations_url":"https://api.github.com/users/drush-ops/orgs","repos_url":"https://api.github.com/users/drush-ops/repos","events_url":"https://api.github.com/users/drush-ops/events{/privacy}","received_events_url":"https://api.github.com/users/drush-ops/received_events","type":"Organization","site_admin":false},"repo":{"id":3193843,"name":"drush","full_name":"drush-ops/drush","owner":{"login":"drush-ops","id":931201,"avatar_url":"https://avatars.githubusercontent.com/u/931201?v=3","gravatar_id":"","url":"https://api.github.com/users/drush-ops","html_url":"https://github.com/drush-ops","followers_url":"https://api.github.com/users/drush-ops/followers","following_url":"https://api.github.com/users/drush-ops/following{/other_user}","gists_url":"https://api.github.com/users/drush-ops/gists{/gist_id}","starred_url":"https://api.github.com/users/drush-ops/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drush-ops/subscriptions","organizations_url":"https://api.github.com/users/drush-ops/orgs","repos_url":"https://api.github.com/users/drush-ops/repos","events_url":"https://api.github.com/users/drush-ops/events{/privacy}","received_events_url":"https://api.github.com/users/drush-ops/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/drush-ops/drush","description":"Drush is a command-line shell and scripting interface for Drupal, a veritable Swiss Army knife designed to make life easier for those who spend their working hours hacking away at the command prompt.","fork":false,"url":"https://api.github.com/repos/drush-ops/drush","forks_url":"https://api.github.com/repos/drush-ops/drush/forks","keys_url":"https://api.github.com/repos/drush-ops/drush/keys{/key_id}","collaborators_url":"https://api.github.com/repos/drush-ops/drush/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/drush-ops/drush/teams","hooks_url":"https://api.github.com/repos/drush-ops/drush/hooks","issue_events_url":"https://api.github.com/repos/drush-ops/drush/issues/events{/number}","events_url":"https://api.github.com/repos/drush-ops/drush/events","assignees_url":"https://api.github.com/repos/drush-ops/drush/assignees{/user}","branches_url":"https://api.github.com/repos/drush-ops/drush/branches{/branch}","tags_url":"https://api.github.com/repos/drush-ops/drush/tags","blobs_url":"https://api.github.com/repos/drush-ops/drush/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/drush-ops/drush/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/drush-ops/drush/git/refs{/sha}","trees_url":"https://api.github.com/repos/drush-ops/drush/git/trees{/sha}","statuses_url":"https://api.github.com/repos/drush-ops/drush/statuses/{sha}","languages_url":"https://api.github.com/repos/drush-ops/drush/languages","stargazers_url":"https://api.github.com/repos/drush-ops/drush/stargazers","contributors_url":"https://api.github.com/repos/drush-ops/drush/contributors","subscribers_url":"https://api.github.com/repos/drush-ops/drush/subscribers","subscription_url":"https://api.github.com/repos/drush-ops/drush/subscription","commits_url":"https://api.github.com/repos/drush-ops/drush/commits{/sha}","git_commits_url":"https://api.github.com/repos/drush-ops/drush/git/commits{/sha}","comments_url":"https://api.github.com/repos/drush-ops/drush/comments{/number}","issue_comment_url":"https://api.github.com/repos/drush-ops/drush/issues/comments{/number}","contents_url":"https://api.github.com/repos/drush-ops/drush/contents/{+path}","compare_url":"https://api.github.com/repos/drush-ops/drush/compare/{base}...{head}","merges_url":"https://api.github.com/repos/drush-ops/drush/merges","archive_url":"https://api.github.com/repos/drush-ops/drush/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/drush-ops/drush/downloads","issues_url":"https://api.github.com/repos/drush-ops/drush/issues{/number}","pulls_url":"https://api.github.com/repos/drush-ops/drush/pulls{/number}","milestones_url":"https://api.github.com/repos/drush-ops/drush/milestones{/number}","notifications_url":"https://api.github.com/repos/drush-ops/drush/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/drush-ops/drush/labels{/name}","releases_url":"https://api.github.com/repos/drush-ops/drush/releases{/id}","created_at":"2012-01-16T20:26:51Z","updated_at":"2015-11-17T11:00:18Z","pushed_at":"2015-11-17T10:13:43Z","git_url":"git://github.com/drush-ops/drush.git","ssh_url":"git@github.com:drush-ops/drush.git","clone_url":"https://github.com/drush-ops/drush.git","svn_url":"https://github.com/drush-ops/drush","homepage":"","size":13642,"stargazers_count":1255,"watchers_count":1255,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":628,"mirror_url":null,"open_issues_count":337,"forks":628,"open_issues":337,"watchers":1255,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/drush-ops/drush/pulls/1775"},"html":{"href":"https://github.com/drush-ops/drush/pull/1775"},"issue":{"href":"https://api.github.com/repos/drush-ops/drush/issues/1775"},"comments":{"href":"https://api.github.com/repos/drush-ops/drush/issues/1775/comments"},"review_comments":{"href":"https://api.github.com/repos/drush-ops/drush/pulls/1775/comments"},"review_comment":{"href":"https://api.github.com/repos/drush-ops/drush/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/drush-ops/drush/pulls/1775/commits"},"statuses":{"href":"https://api.github.com/repos/drush-ops/drush/statuses/3dadf08504f26b339cdf1a93ec9925fd1748890f"}}}}