{"action":"closed","number":1307,"pull_request":{"url":"https://api.github.com/repos/php/php-src/pulls/1307","id":36446301,"html_url":"https://github.com/php/php-src/pull/1307","diff_url":"https://github.com/php/php-src/pull/1307.diff","patch_url":"https://github.com/php/php-src/pull/1307.patch","issue_url":"https://api.github.com/repos/php/php-src/issues/1307","number":1307,"state":"closed","locked":false,"title":"Add ordering constants: CMP_LT, CMP_EQ, CMP_GT","user":{"login":"TazeTSchnitzel","id":579774,"avatar_url":"https://avatars.githubusercontent.com/u/579774?v=3","gravatar_id":"","url":"https://api.github.com/users/TazeTSchnitzel","html_url":"https://github.com/TazeTSchnitzel","followers_url":"https://api.github.com/users/TazeTSchnitzel/followers","following_url":"https://api.github.com/users/TazeTSchnitzel/following{/other_user}","gists_url":"https://api.github.com/users/TazeTSchnitzel/gists{/gist_id}","starred_url":"https://api.github.com/users/TazeTSchnitzel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TazeTSchnitzel/subscriptions","organizations_url":"https://api.github.com/users/TazeTSchnitzel/orgs","repos_url":"https://api.github.com/users/TazeTSchnitzel/repos","events_url":"https://api.github.com/users/TazeTSchnitzel/events{/privacy}","received_events_url":"https://api.github.com/users/TazeTSchnitzel/received_events","type":"User","site_admin":false},"body":"This adds three constants to PHP:\r\n\r\n```php\r\nconst CMP_LT = -1;\r\nconst CMP_EQ = 0;\r\nconst CMP_GT = 1;\r\n```\r\n\r\nWhy? Code readability. It means you can replace the magic numbers with more human-readable names, and prevent misunderstandings (particularly as to what `strcmp($a, $b) === 0` does).\r\n\r\nFor example:\r\n\r\n```php\r\nswitch ($a <=> $b) {\r\n    case CMP_LT:\r\n        ...\r\n    case CMP_EQ:\r\n        ...\r\n    case CMP_GT:\r\n        ...\r\n}\r\n```\r\n\r\nor\r\n\r\n```php\r\nif (CMP_EQ === strcmp($a, $b)) {\r\n    ...\r\n}\r\n```","created_at":"2015-05-28T20:17:42Z","updated_at":"2015-05-28T20:28:04Z","closed_at":"2015-05-28T20:28:04Z","merged_at":null,"merge_commit_sha":"0e545594ee34c93f9c26b638a55e42173be604d1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/php/php-src/pulls/1307/commits","review_comments_url":"https://api.github.com/repos/php/php-src/pulls/1307/comments","review_comment_url":"https://api.github.com/repos/php/php-src/pulls/comments{/number}","comments_url":"https://api.github.com/repos/php/php-src/issues/1307/comments","statuses_url":"https://api.github.com/repos/php/php-src/statuses/b4b0ba81769f9e184dcaf953cb1ff825bb4d0341","head":{"label":"TazeTSchnitzel:ordering-constants","ref":"ordering-constants","sha":"b4b0ba81769f9e184dcaf953cb1ff825bb4d0341","user":{"login":"TazeTSchnitzel","id":579774,"avatar_url":"https://avatars.githubusercontent.com/u/579774?v=3","gravatar_id":"","url":"https://api.github.com/users/TazeTSchnitzel","html_url":"https://github.com/TazeTSchnitzel","followers_url":"https://api.github.com/users/TazeTSchnitzel/followers","following_url":"https://api.github.com/users/TazeTSchnitzel/following{/other_user}","gists_url":"https://api.github.com/users/TazeTSchnitzel/gists{/gist_id}","starred_url":"https://api.github.com/users/TazeTSchnitzel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TazeTSchnitzel/subscriptions","organizations_url":"https://api.github.com/users/TazeTSchnitzel/orgs","repos_url":"https://api.github.com/users/TazeTSchnitzel/repos","events_url":"https://api.github.com/users/TazeTSchnitzel/events{/privacy}","received_events_url":"https://api.github.com/users/TazeTSchnitzel/received_events","type":"User","site_admin":false},"repo":{"id":5008364,"name":"php-src","full_name":"TazeTSchnitzel/php-src","owner":{"login":"TazeTSchnitzel","id":579774,"avatar_url":"https://avatars.githubusercontent.com/u/579774?v=3","gravatar_id":"","url":"https://api.github.com/users/TazeTSchnitzel","html_url":"https://github.com/TazeTSchnitzel","followers_url":"https://api.github.com/users/TazeTSchnitzel/followers","following_url":"https://api.github.com/users/TazeTSchnitzel/following{/other_user}","gists_url":"https://api.github.com/users/TazeTSchnitzel/gists{/gist_id}","starred_url":"https://api.github.com/users/TazeTSchnitzel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TazeTSchnitzel/subscriptions","organizations_url":"https://api.github.com/users/TazeTSchnitzel/orgs","repos_url":"https://api.github.com/users/TazeTSchnitzel/repos","events_url":"https://api.github.com/users/TazeTSchnitzel/events{/privacy}","received_events_url":"https://api.github.com/users/TazeTSchnitzel/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/TazeTSchnitzel/php-src","description":"The PHP Interpreter","fork":true,"url":"https://api.github.com/repos/TazeTSchnitzel/php-src","forks_url":"https://api.github.com/repos/TazeTSchnitzel/php-src/forks","keys_url":"https://api.github.com/repos/TazeTSchnitzel/php-src/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TazeTSchnitzel/php-src/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TazeTSchnitzel/php-src/teams","hooks_url":"https://api.github.com/repos/TazeTSchnitzel/php-src/hooks","issue_events_url":"https://api.github.com/repos/TazeTSchnitzel/php-src/issues/events{/number}","events_url":"https://api.github.com/repos/TazeTSchnitzel/php-src/events","assignees_url":"https://api.github.com/repos/TazeTSchnitzel/php-src/assignees{/user}","branches_url":"https://api.github.com/repos/TazeTSchnitzel/php-src/branches{/branch}","tags_url":"https://api.github.com/repos/TazeTSchnitzel/php-src/tags","blobs_url":"https://api.github.com/repos/TazeTSchnitzel/php-src/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TazeTSchnitzel/php-src/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TazeTSchnitzel/php-src/git/refs{/sha}","trees_url":"https://api.github.com/repos/TazeTSchnitzel/php-src/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TazeTSchnitzel/php-src/statuses/{sha}","languages_url":"https://api.github.com/repos/TazeTSchnitzel/php-src/languages","stargazers_url":"https://api.github.com/repos/TazeTSchnitzel/php-src/stargazers","contributors_url":"https://api.github.com/repos/TazeTSchnitzel/php-src/contributors","subscribers_url":"https://api.github.com/repos/TazeTSchnitzel/php-src/subscribers","subscription_url":"https://api.github.com/repos/TazeTSchnitzel/php-src/subscription","commits_url":"https://api.github.com/repos/TazeTSchnitzel/php-src/commits{/sha}","git_commits_url":"https://api.github.com/repos/TazeTSchnitzel/php-src/git/commits{/sha}","comments_url":"https://api.github.com/repos/TazeTSchnitzel/php-src/comments{/number}","issue_comment_url":"https://api.github.com/repos/TazeTSchnitzel/php-src/issues/comments{/number}","contents_url":"https://api.github.com/repos/TazeTSchnitzel/php-src/contents/{+path}","compare_url":"https://api.github.com/repos/TazeTSchnitzel/php-src/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TazeTSchnitzel/php-src/merges","archive_url":"https://api.github.com/repos/TazeTSchnitzel/php-src/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TazeTSchnitzel/php-src/downloads","issues_url":"https://api.github.com/repos/TazeTSchnitzel/php-src/issues{/number}","pulls_url":"https://api.github.com/repos/TazeTSchnitzel/php-src/pulls{/number}","milestones_url":"https://api.github.com/repos/TazeTSchnitzel/php-src/milestones{/number}","notifications_url":"https://api.github.com/repos/TazeTSchnitzel/php-src/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TazeTSchnitzel/php-src/labels{/name}","releases_url":"https://api.github.com/repos/TazeTSchnitzel/php-src/releases{/id}","created_at":"2012-07-12T18:48:08Z","updated_at":"2015-01-06T21:54:12Z","pushed_at":"2015-05-28T20:27:33Z","git_url":"git://github.com/TazeTSchnitzel/php-src.git","ssh_url":"git@github.com:TazeTSchnitzel/php-src.git","clone_url":"https://github.com/TazeTSchnitzel/php-src.git","svn_url":"https://github.com/TazeTSchnitzel/php-src","homepage":"http://www.php.net","size":238776,"stargazers_count":3,"watchers_count":3,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":3,"default_branch":"master"}},"base":{"label":"php:master","ref":"master","sha":"50e08d60b66d7cdc47f61fbe73b7ebfea8da0acc","user":{"login":"php","id":25158,"avatar_url":"https://avatars.githubusercontent.com/u/25158?v=3","gravatar_id":"","url":"https://api.github.com/users/php","html_url":"https://github.com/php","followers_url":"https://api.github.com/users/php/followers","following_url":"https://api.github.com/users/php/following{/other_user}","gists_url":"https://api.github.com/users/php/gists{/gist_id}","starred_url":"https://api.github.com/users/php/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/php/subscriptions","organizations_url":"https://api.github.com/users/php/orgs","repos_url":"https://api.github.com/users/php/repos","events_url":"https://api.github.com/users/php/events{/privacy}","received_events_url":"https://api.github.com/users/php/received_events","type":"Organization","site_admin":false},"repo":{"id":1903522,"name":"php-src","full_name":"php/php-src","owner":{"login":"php","id":25158,"avatar_url":"https://avatars.githubusercontent.com/u/25158?v=3","gravatar_id":"","url":"https://api.github.com/users/php","html_url":"https://github.com/php","followers_url":"https://api.github.com/users/php/followers","following_url":"https://api.github.com/users/php/following{/other_user}","gists_url":"https://api.github.com/users/php/gists{/gist_id}","starred_url":"https://api.github.com/users/php/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/php/subscriptions","organizations_url":"https://api.github.com/users/php/orgs","repos_url":"https://api.github.com/users/php/repos","events_url":"https://api.github.com/users/php/events{/privacy}","received_events_url":"https://api.github.com/users/php/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/php/php-src","description":"The PHP Interpreter","fork":false,"url":"https://api.github.com/repos/php/php-src","forks_url":"https://api.github.com/repos/php/php-src/forks","keys_url":"https://api.github.com/repos/php/php-src/keys{/key_id}","collaborators_url":"https://api.github.com/repos/php/php-src/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/php/php-src/teams","hooks_url":"https://api.github.com/repos/php/php-src/hooks","issue_events_url":"https://api.github.com/repos/php/php-src/issues/events{/number}","events_url":"https://api.github.com/repos/php/php-src/events","assignees_url":"https://api.github.com/repos/php/php-src/assignees{/user}","branches_url":"https://api.github.com/repos/php/php-src/branches{/branch}","tags_url":"https://api.github.com/repos/php/php-src/tags","blobs_url":"https://api.github.com/repos/php/php-src/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/php/php-src/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/php/php-src/git/refs{/sha}","trees_url":"https://api.github.com/repos/php/php-src/git/trees{/sha}","statuses_url":"https://api.github.com/repos/php/php-src/statuses/{sha}","languages_url":"https://api.github.com/repos/php/php-src/languages","stargazers_url":"https://api.github.com/repos/php/php-src/stargazers","contributors_url":"https://api.github.com/repos/php/php-src/contributors","subscribers_url":"https://api.github.com/repos/php/php-src/subscribers","subscription_url":"https://api.github.com/repos/php/php-src/subscription","commits_url":"https://api.github.com/repos/php/php-src/commits{/sha}","git_commits_url":"https://api.github.com/repos/php/php-src/git/commits{/sha}","comments_url":"https://api.github.com/repos/php/php-src/comments{/number}","issue_comment_url":"https://api.github.com/repos/php/php-src/issues/comments{/number}","contents_url":"https://api.github.com/repos/php/php-src/contents/{+path}","compare_url":"https://api.github.com/repos/php/php-src/compare/{base}...{head}","merges_url":"https://api.github.com/repos/php/php-src/merges","archive_url":"https://api.github.com/repos/php/php-src/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/php/php-src/downloads","issues_url":"https://api.github.com/repos/php/php-src/issues{/number}","pulls_url":"https://api.github.com/repos/php/php-src/pulls{/number}","milestones_url":"https://api.github.com/repos/php/php-src/milestones{/number}","notifications_url":"https://api.github.com/repos/php/php-src/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/php/php-src/labels{/name}","releases_url":"https://api.github.com/repos/php/php-src/releases{/id}","created_at":"2011-06-16T01:52:25Z","updated_at":"2015-05-28T19:27:59Z","pushed_at":"2015-05-28T20:27:43Z","git_url":"git://github.com/php/php-src.git","ssh_url":"git@github.com:php/php-src.git","clone_url":"https://github.com/php/php-src.git","svn_url":"https://github.com/php/php-src","homepage":"http://www.php.net","size":4018315,"stargazers_count":5929,"watchers_count":5929,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2144,"mirror_url":null,"open_issues_count":196,"forks":2144,"open_issues":196,"watchers":5929,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/php/php-src/pulls/1307"},"html":{"href":"https://github.com/php/php-src/pull/1307"},"issue":{"href":"https://api.github.com/repos/php/php-src/issues/1307"},"comments":{"href":"https://api.github.com/repos/php/php-src/issues/1307/comments"},"review_comments":{"href":"https://api.github.com/repos/php/php-src/pulls/1307/comments"},"review_comment":{"href":"https://api.github.com/repos/php/php-src/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/php/php-src/pulls/1307/commits"},"statuses":{"href":"https://api.github.com/repos/php/php-src/statuses/b4b0ba81769f9e184dcaf953cb1ff825bb4d0341"}},"merged":false,"mergeable":true,"mergeable_state":"unstable","merged_by":null,"comments":1,"review_comments":0,"commits":2,"additions":39,"deletions":0,"changed_files":2}}