{"action":"closed","number":6151,"pull_request":{"url":"https://api.github.com/repos/facebook/hhvm/pulls/6151","id":43344589,"html_url":"https://github.com/facebook/hhvm/pull/6151","diff_url":"https://github.com/facebook/hhvm/pull/6151.diff","patch_url":"https://github.com/facebook/hhvm/pull/6151.patch","issue_url":"https://api.github.com/repos/facebook/hhvm/issues/6151","number":6151,"state":"closed","locked":false,"title":"Only call mbfl_strlen in invalid conditions in mb_substr.","user":{"login":"wjywbs","id":6233680,"avatar_url":"https://avatars.githubusercontent.com/u/6233680?v=3","gravatar_id":"","url":"https://api.github.com/users/wjywbs","html_url":"https://github.com/wjywbs","followers_url":"https://api.github.com/users/wjywbs/followers","following_url":"https://api.github.com/users/wjywbs/following{/other_user}","gists_url":"https://api.github.com/users/wjywbs/gists{/gist_id}","starred_url":"https://api.github.com/users/wjywbs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wjywbs/subscriptions","organizations_url":"https://api.github.com/users/wjywbs/orgs","repos_url":"https://api.github.com/users/wjywbs/repos","events_url":"https://api.github.com/users/wjywbs/events{/privacy}","received_events_url":"https://api.github.com/users/wjywbs/received_events","type":"User","site_admin":false},"body":"HHVM always calculates the length of the string in mb_substr which is slower\r\nthan php. Use the same logic in php to improve performance. Part of #6014.\r\n\r\nhttps://github.com/php/php-src/blob/4a2e40b/ext/mbstring/mbstring.c#L2800","created_at":"2015-08-25T22:28:43Z","updated_at":"2015-10-14T19:48:08Z","closed_at":"2015-10-14T19:48:08Z","merged_at":null,"merge_commit_sha":"f0236b40bbf97c4dcc2081697640b59fe56af44a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/facebook/hhvm/pulls/6151/commits","review_comments_url":"https://api.github.com/repos/facebook/hhvm/pulls/6151/comments","review_comment_url":"https://api.github.com/repos/facebook/hhvm/pulls/comments{/number}","comments_url":"https://api.github.com/repos/facebook/hhvm/issues/6151/comments","statuses_url":"https://api.github.com/repos/facebook/hhvm/statuses/3a33455d570cb1cf51289fb290004f2ea9ebe23e","head":{"label":"wjywbs:mb_substr_php","ref":"mb_substr_php","sha":"3a33455d570cb1cf51289fb290004f2ea9ebe23e","user":{"login":"wjywbs","id":6233680,"avatar_url":"https://avatars.githubusercontent.com/u/6233680?v=3","gravatar_id":"","url":"https://api.github.com/users/wjywbs","html_url":"https://github.com/wjywbs","followers_url":"https://api.github.com/users/wjywbs/followers","following_url":"https://api.github.com/users/wjywbs/following{/other_user}","gists_url":"https://api.github.com/users/wjywbs/gists{/gist_id}","starred_url":"https://api.github.com/users/wjywbs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wjywbs/subscriptions","organizations_url":"https://api.github.com/users/wjywbs/orgs","repos_url":"https://api.github.com/users/wjywbs/repos","events_url":"https://api.github.com/users/wjywbs/events{/privacy}","received_events_url":"https://api.github.com/users/wjywbs/received_events","type":"User","site_admin":false},"repo":{"id":26509346,"name":"hhvm","full_name":"wjywbs/hhvm","owner":{"login":"wjywbs","id":6233680,"avatar_url":"https://avatars.githubusercontent.com/u/6233680?v=3","gravatar_id":"","url":"https://api.github.com/users/wjywbs","html_url":"https://github.com/wjywbs","followers_url":"https://api.github.com/users/wjywbs/followers","following_url":"https://api.github.com/users/wjywbs/following{/other_user}","gists_url":"https://api.github.com/users/wjywbs/gists{/gist_id}","starred_url":"https://api.github.com/users/wjywbs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wjywbs/subscriptions","organizations_url":"https://api.github.com/users/wjywbs/orgs","repos_url":"https://api.github.com/users/wjywbs/repos","events_url":"https://api.github.com/users/wjywbs/events{/privacy}","received_events_url":"https://api.github.com/users/wjywbs/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/wjywbs/hhvm","description":"HHVM is an open-source virtual machine designed for executing programs written in Hack and PHP. ","fork":true,"url":"https://api.github.com/repos/wjywbs/hhvm","forks_url":"https://api.github.com/repos/wjywbs/hhvm/forks","keys_url":"https://api.github.com/repos/wjywbs/hhvm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wjywbs/hhvm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wjywbs/hhvm/teams","hooks_url":"https://api.github.com/repos/wjywbs/hhvm/hooks","issue_events_url":"https://api.github.com/repos/wjywbs/hhvm/issues/events{/number}","events_url":"https://api.github.com/repos/wjywbs/hhvm/events","assignees_url":"https://api.github.com/repos/wjywbs/hhvm/assignees{/user}","branches_url":"https://api.github.com/repos/wjywbs/hhvm/branches{/branch}","tags_url":"https://api.github.com/repos/wjywbs/hhvm/tags","blobs_url":"https://api.github.com/repos/wjywbs/hhvm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wjywbs/hhvm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wjywbs/hhvm/git/refs{/sha}","trees_url":"https://api.github.com/repos/wjywbs/hhvm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wjywbs/hhvm/statuses/{sha}","languages_url":"https://api.github.com/repos/wjywbs/hhvm/languages","stargazers_url":"https://api.github.com/repos/wjywbs/hhvm/stargazers","contributors_url":"https://api.github.com/repos/wjywbs/hhvm/contributors","subscribers_url":"https://api.github.com/repos/wjywbs/hhvm/subscribers","subscription_url":"https://api.github.com/repos/wjywbs/hhvm/subscription","commits_url":"https://api.github.com/repos/wjywbs/hhvm/commits{/sha}","git_commits_url":"https://api.github.com/repos/wjywbs/hhvm/git/commits{/sha}","comments_url":"https://api.github.com/repos/wjywbs/hhvm/comments{/number}","issue_comment_url":"https://api.github.com/repos/wjywbs/hhvm/issues/comments{/number}","contents_url":"https://api.github.com/repos/wjywbs/hhvm/contents/{+path}","compare_url":"https://api.github.com/repos/wjywbs/hhvm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wjywbs/hhvm/merges","archive_url":"https://api.github.com/repos/wjywbs/hhvm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wjywbs/hhvm/downloads","issues_url":"https://api.github.com/repos/wjywbs/hhvm/issues{/number}","pulls_url":"https://api.github.com/repos/wjywbs/hhvm/pulls{/number}","milestones_url":"https://api.github.com/repos/wjywbs/hhvm/milestones{/number}","notifications_url":"https://api.github.com/repos/wjywbs/hhvm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wjywbs/hhvm/labels{/name}","releases_url":"https://api.github.com/repos/wjywbs/hhvm/releases{/id}","created_at":"2014-11-11T23:12:35Z","updated_at":"2015-05-07T14:08:19Z","pushed_at":"2015-10-14T01:40:12Z","git_url":"git://github.com/wjywbs/hhvm.git","ssh_url":"git@github.com:wjywbs/hhvm.git","clone_url":"https://github.com/wjywbs/hhvm.git","svn_url":"https://github.com/wjywbs/hhvm","homepage":"http://hhvm.com","size":217819,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":false,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"facebook:master","ref":"master","sha":"991973e74588e2da4cd800c0e4cf03430094649a","user":{"login":"facebook","id":69631,"avatar_url":"https://avatars.githubusercontent.com/u/69631?v=3","gravatar_id":"","url":"https://api.github.com/users/facebook","html_url":"https://github.com/facebook","followers_url":"https://api.github.com/users/facebook/followers","following_url":"https://api.github.com/users/facebook/following{/other_user}","gists_url":"https://api.github.com/users/facebook/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook/subscriptions","organizations_url":"https://api.github.com/users/facebook/orgs","repos_url":"https://api.github.com/users/facebook/repos","events_url":"https://api.github.com/users/facebook/events{/privacy}","received_events_url":"https://api.github.com/users/facebook/received_events","type":"Organization","site_admin":false},"repo":{"id":455600,"name":"hhvm","full_name":"facebook/hhvm","owner":{"login":"facebook","id":69631,"avatar_url":"https://avatars.githubusercontent.com/u/69631?v=3","gravatar_id":"","url":"https://api.github.com/users/facebook","html_url":"https://github.com/facebook","followers_url":"https://api.github.com/users/facebook/followers","following_url":"https://api.github.com/users/facebook/following{/other_user}","gists_url":"https://api.github.com/users/facebook/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook/subscriptions","organizations_url":"https://api.github.com/users/facebook/orgs","repos_url":"https://api.github.com/users/facebook/repos","events_url":"https://api.github.com/users/facebook/events{/privacy}","received_events_url":"https://api.github.com/users/facebook/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/facebook/hhvm","description":"A virtual machine designed for executing programs written in Hack and PHP. ","fork":false,"url":"https://api.github.com/repos/facebook/hhvm","forks_url":"https://api.github.com/repos/facebook/hhvm/forks","keys_url":"https://api.github.com/repos/facebook/hhvm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/facebook/hhvm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/facebook/hhvm/teams","hooks_url":"https://api.github.com/repos/facebook/hhvm/hooks","issue_events_url":"https://api.github.com/repos/facebook/hhvm/issues/events{/number}","events_url":"https://api.github.com/repos/facebook/hhvm/events","assignees_url":"https://api.github.com/repos/facebook/hhvm/assignees{/user}","branches_url":"https://api.github.com/repos/facebook/hhvm/branches{/branch}","tags_url":"https://api.github.com/repos/facebook/hhvm/tags","blobs_url":"https://api.github.com/repos/facebook/hhvm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/facebook/hhvm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/facebook/hhvm/git/refs{/sha}","trees_url":"https://api.github.com/repos/facebook/hhvm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/facebook/hhvm/statuses/{sha}","languages_url":"https://api.github.com/repos/facebook/hhvm/languages","stargazers_url":"https://api.github.com/repos/facebook/hhvm/stargazers","contributors_url":"https://api.github.com/repos/facebook/hhvm/contributors","subscribers_url":"https://api.github.com/repos/facebook/hhvm/subscribers","subscription_url":"https://api.github.com/repos/facebook/hhvm/subscription","commits_url":"https://api.github.com/repos/facebook/hhvm/commits{/sha}","git_commits_url":"https://api.github.com/repos/facebook/hhvm/git/commits{/sha}","comments_url":"https://api.github.com/repos/facebook/hhvm/comments{/number}","issue_comment_url":"https://api.github.com/repos/facebook/hhvm/issues/comments{/number}","contents_url":"https://api.github.com/repos/facebook/hhvm/contents/{+path}","compare_url":"https://api.github.com/repos/facebook/hhvm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/facebook/hhvm/merges","archive_url":"https://api.github.com/repos/facebook/hhvm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/facebook/hhvm/downloads","issues_url":"https://api.github.com/repos/facebook/hhvm/issues{/number}","pulls_url":"https://api.github.com/repos/facebook/hhvm/pulls{/number}","milestones_url":"https://api.github.com/repos/facebook/hhvm/milestones{/number}","notifications_url":"https://api.github.com/repos/facebook/hhvm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/facebook/hhvm/labels{/name}","releases_url":"https://api.github.com/repos/facebook/hhvm/releases{/id}","created_at":"2010-01-02T01:17:06Z","updated_at":"2015-10-14T15:35:47Z","pushed_at":"2015-10-14T19:48:05Z","git_url":"git://github.com/facebook/hhvm.git","ssh_url":"git@github.com:facebook/hhvm.git","clone_url":"https://github.com/facebook/hhvm.git","svn_url":"https://github.com/facebook/hhvm","homepage":"http://hhvm.com","size":499234,"stargazers_count":12734,"watchers_count":12734,"language":"C++","has_issues":true,"has_downloads":false,"has_wiki":true,"has_pages":false,"forks_count":2301,"mirror_url":null,"open_issues_count":981,"forks":2301,"open_issues":981,"watchers":12734,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/facebook/hhvm/pulls/6151"},"html":{"href":"https://github.com/facebook/hhvm/pull/6151"},"issue":{"href":"https://api.github.com/repos/facebook/hhvm/issues/6151"},"comments":{"href":"https://api.github.com/repos/facebook/hhvm/issues/6151/comments"},"review_comments":{"href":"https://api.github.com/repos/facebook/hhvm/pulls/6151/comments"},"review_comment":{"href":"https://api.github.com/repos/facebook/hhvm/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/facebook/hhvm/pulls/6151/commits"},"statuses":{"href":"https://api.github.com/repos/facebook/hhvm/statuses/3a33455d570cb1cf51289fb290004f2ea9ebe23e"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":1,"review_comments":0,"commits":1,"additions":16,"deletions":11,"changed_files":1}}