{"action":"closed","number":98,"pull_request":{"url":"https://api.github.com/repos/pusher/pusher-http-php/pulls/98","id":66194449,"html_url":"https://github.com/pusher/pusher-http-php/pull/98","diff_url":"https://github.com/pusher/pusher-http-php/pull/98.diff","patch_url":"https://github.com/pusher/pusher-http-php/pull/98.patch","issue_url":"https://api.github.com/repos/pusher/pusher-http-php/issues/98","number":98,"state":"closed","locked":false,"title":"Fix for failures when doing multiple pusher requests","user":{"login":"Dolondro","id":1678803,"avatar_url":"https://avatars.githubusercontent.com/u/1678803?v=3","gravatar_id":"","url":"https://api.github.com/users/Dolondro","html_url":"https://github.com/Dolondro","followers_url":"https://api.github.com/users/Dolondro/followers","following_url":"https://api.github.com/users/Dolondro/following{/other_user}","gists_url":"https://api.github.com/users/Dolondro/gists{/gist_id}","starred_url":"https://api.github.com/users/Dolondro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Dolondro/subscriptions","organizations_url":"https://api.github.com/users/Dolondro/orgs","repos_url":"https://api.github.com/users/Dolondro/repos","events_url":"https://api.github.com/users/Dolondro/events{/privacy}","received_events_url":"https://api.github.com/users/Dolondro/received_events","type":"User","site_admin":false},"body":"One of the latest [commits](https://github.com/pusher/pusher-http-php/pull/97/commits/ef44c869227db989e8c7d083a5d71c8e53c265e7) closes the curl handler at the end of submitting a request.\r\n\r\nIn PHP7, this seems to work fine (as closing a curl handler sets the curl handler to be null), on PHP5.5 it will continue to be tagged as a resource (but as an `unknown` resource rather than a `curl` resource) so it'll fail when it comes round to create_curl as it checks if it's null rather than whether it's actually a curl resource.\r\n\r\nThe attempt to set $ch to null immediately after curl_close will do nothing as $ch in itself isn't byref, only the actual object is.\r\n\r\nThe long and short of this is, this change means that on PHP 5.5 if you try and send two messages, it'll work for the first message and fail for all subsequent messages. \r\n\r\nAs I assume the `static $ch` is entirely for the point of reusing the curl handler for efficiency purposes, I've removed the curl_close again. If the curl_close is wanted (you could argue either way, and probably argue it's a macro-optimisation either way) I would propose moving $ch object to being on the class so you can easily do `$this->ch = null` which would negate this issue.","created_at":"2016-04-12T17:14:41Z","updated_at":"2016-04-13T00:28:55Z","closed_at":"2016-04-13T00:28:55Z","merged_at":"2016-04-13T00:28:55Z","merge_commit_sha":"db3e9e9c8853a88c02876244b42d269dc93849e2","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/pusher/pusher-http-php/pulls/98/commits","review_comments_url":"https://api.github.com/repos/pusher/pusher-http-php/pulls/98/comments","review_comment_url":"https://api.github.com/repos/pusher/pusher-http-php/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pusher/pusher-http-php/issues/98/comments","statuses_url":"https://api.github.com/repos/pusher/pusher-http-php/statuses/1a32b0df9b18311571a76297b23c6e5173423979","head":{"label":"Dolondro:master","ref":"master","sha":"1a32b0df9b18311571a76297b23c6e5173423979","user":{"login":"Dolondro","id":1678803,"avatar_url":"https://avatars.githubusercontent.com/u/1678803?v=3","gravatar_id":"","url":"https://api.github.com/users/Dolondro","html_url":"https://github.com/Dolondro","followers_url":"https://api.github.com/users/Dolondro/followers","following_url":"https://api.github.com/users/Dolondro/following{/other_user}","gists_url":"https://api.github.com/users/Dolondro/gists{/gist_id}","starred_url":"https://api.github.com/users/Dolondro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Dolondro/subscriptions","organizations_url":"https://api.github.com/users/Dolondro/orgs","repos_url":"https://api.github.com/users/Dolondro/repos","events_url":"https://api.github.com/users/Dolondro/events{/privacy}","received_events_url":"https://api.github.com/users/Dolondro/received_events","type":"User","site_admin":false},"repo":{"id":56081012,"name":"pusher-http-php","full_name":"Dolondro/pusher-http-php","owner":{"login":"Dolondro","id":1678803,"avatar_url":"https://avatars.githubusercontent.com/u/1678803?v=3","gravatar_id":"","url":"https://api.github.com/users/Dolondro","html_url":"https://github.com/Dolondro","followers_url":"https://api.github.com/users/Dolondro/followers","following_url":"https://api.github.com/users/Dolondro/following{/other_user}","gists_url":"https://api.github.com/users/Dolondro/gists{/gist_id}","starred_url":"https://api.github.com/users/Dolondro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Dolondro/subscriptions","organizations_url":"https://api.github.com/users/Dolondro/orgs","repos_url":"https://api.github.com/users/Dolondro/repos","events_url":"https://api.github.com/users/Dolondro/events{/privacy}","received_events_url":"https://api.github.com/users/Dolondro/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Dolondro/pusher-http-php","description":"PHP library for interacting with the Pusher HTTP API | owner=@zimbatm","fork":true,"url":"https://api.github.com/repos/Dolondro/pusher-http-php","forks_url":"https://api.github.com/repos/Dolondro/pusher-http-php/forks","keys_url":"https://api.github.com/repos/Dolondro/pusher-http-php/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Dolondro/pusher-http-php/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Dolondro/pusher-http-php/teams","hooks_url":"https://api.github.com/repos/Dolondro/pusher-http-php/hooks","issue_events_url":"https://api.github.com/repos/Dolondro/pusher-http-php/issues/events{/number}","events_url":"https://api.github.com/repos/Dolondro/pusher-http-php/events","assignees_url":"https://api.github.com/repos/Dolondro/pusher-http-php/assignees{/user}","branches_url":"https://api.github.com/repos/Dolondro/pusher-http-php/branches{/branch}","tags_url":"https://api.github.com/repos/Dolondro/pusher-http-php/tags","blobs_url":"https://api.github.com/repos/Dolondro/pusher-http-php/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Dolondro/pusher-http-php/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Dolondro/pusher-http-php/git/refs{/sha}","trees_url":"https://api.github.com/repos/Dolondro/pusher-http-php/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Dolondro/pusher-http-php/statuses/{sha}","languages_url":"https://api.github.com/repos/Dolondro/pusher-http-php/languages","stargazers_url":"https://api.github.com/repos/Dolondro/pusher-http-php/stargazers","contributors_url":"https://api.github.com/repos/Dolondro/pusher-http-php/contributors","subscribers_url":"https://api.github.com/repos/Dolondro/pusher-http-php/subscribers","subscription_url":"https://api.github.com/repos/Dolondro/pusher-http-php/subscription","commits_url":"https://api.github.com/repos/Dolondro/pusher-http-php/commits{/sha}","git_commits_url":"https://api.github.com/repos/Dolondro/pusher-http-php/git/commits{/sha}","comments_url":"https://api.github.com/repos/Dolondro/pusher-http-php/comments{/number}","issue_comment_url":"https://api.github.com/repos/Dolondro/pusher-http-php/issues/comments{/number}","contents_url":"https://api.github.com/repos/Dolondro/pusher-http-php/contents/{+path}","compare_url":"https://api.github.com/repos/Dolondro/pusher-http-php/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Dolondro/pusher-http-php/merges","archive_url":"https://api.github.com/repos/Dolondro/pusher-http-php/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Dolondro/pusher-http-php/downloads","issues_url":"https://api.github.com/repos/Dolondro/pusher-http-php/issues{/number}","pulls_url":"https://api.github.com/repos/Dolondro/pusher-http-php/pulls{/number}","milestones_url":"https://api.github.com/repos/Dolondro/pusher-http-php/milestones{/number}","notifications_url":"https://api.github.com/repos/Dolondro/pusher-http-php/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Dolondro/pusher-http-php/labels{/name}","releases_url":"https://api.github.com/repos/Dolondro/pusher-http-php/releases{/id}","deployments_url":"https://api.github.com/repos/Dolondro/pusher-http-php/deployments","created_at":"2016-04-12T16:45:14Z","updated_at":"2016-04-12T16:45:15Z","pushed_at":"2016-04-12T22:41:50Z","git_url":"git://github.com/Dolondro/pusher-http-php.git","ssh_url":"git@github.com:Dolondro/pusher-http-php.git","clone_url":"https://github.com/Dolondro/pusher-http-php.git","svn_url":"https://github.com/Dolondro/pusher-http-php","homepage":"","size":391,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"pusher:master","ref":"master","sha":"57fd7d1df85f9723105f147216da762719d86c3a","user":{"login":"pusher","id":739550,"avatar_url":"https://avatars.githubusercontent.com/u/739550?v=3","gravatar_id":"","url":"https://api.github.com/users/pusher","html_url":"https://github.com/pusher","followers_url":"https://api.github.com/users/pusher/followers","following_url":"https://api.github.com/users/pusher/following{/other_user}","gists_url":"https://api.github.com/users/pusher/gists{/gist_id}","starred_url":"https://api.github.com/users/pusher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pusher/subscriptions","organizations_url":"https://api.github.com/users/pusher/orgs","repos_url":"https://api.github.com/users/pusher/repos","events_url":"https://api.github.com/users/pusher/events{/privacy}","received_events_url":"https://api.github.com/users/pusher/received_events","type":"Organization","site_admin":false},"repo":{"id":5249039,"name":"pusher-http-php","full_name":"pusher/pusher-http-php","owner":{"login":"pusher","id":739550,"avatar_url":"https://avatars.githubusercontent.com/u/739550?v=3","gravatar_id":"","url":"https://api.github.com/users/pusher","html_url":"https://github.com/pusher","followers_url":"https://api.github.com/users/pusher/followers","following_url":"https://api.github.com/users/pusher/following{/other_user}","gists_url":"https://api.github.com/users/pusher/gists{/gist_id}","starred_url":"https://api.github.com/users/pusher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pusher/subscriptions","organizations_url":"https://api.github.com/users/pusher/orgs","repos_url":"https://api.github.com/users/pusher/repos","events_url":"https://api.github.com/users/pusher/events{/privacy}","received_events_url":"https://api.github.com/users/pusher/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pusher/pusher-http-php","description":"PHP library for interacting with the Pusher HTTP API | owner=@zimbatm","fork":false,"url":"https://api.github.com/repos/pusher/pusher-http-php","forks_url":"https://api.github.com/repos/pusher/pusher-http-php/forks","keys_url":"https://api.github.com/repos/pusher/pusher-http-php/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pusher/pusher-http-php/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pusher/pusher-http-php/teams","hooks_url":"https://api.github.com/repos/pusher/pusher-http-php/hooks","issue_events_url":"https://api.github.com/repos/pusher/pusher-http-php/issues/events{/number}","events_url":"https://api.github.com/repos/pusher/pusher-http-php/events","assignees_url":"https://api.github.com/repos/pusher/pusher-http-php/assignees{/user}","branches_url":"https://api.github.com/repos/pusher/pusher-http-php/branches{/branch}","tags_url":"https://api.github.com/repos/pusher/pusher-http-php/tags","blobs_url":"https://api.github.com/repos/pusher/pusher-http-php/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pusher/pusher-http-php/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pusher/pusher-http-php/git/refs{/sha}","trees_url":"https://api.github.com/repos/pusher/pusher-http-php/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pusher/pusher-http-php/statuses/{sha}","languages_url":"https://api.github.com/repos/pusher/pusher-http-php/languages","stargazers_url":"https://api.github.com/repos/pusher/pusher-http-php/stargazers","contributors_url":"https://api.github.com/repos/pusher/pusher-http-php/contributors","subscribers_url":"https://api.github.com/repos/pusher/pusher-http-php/subscribers","subscription_url":"https://api.github.com/repos/pusher/pusher-http-php/subscription","commits_url":"https://api.github.com/repos/pusher/pusher-http-php/commits{/sha}","git_commits_url":"https://api.github.com/repos/pusher/pusher-http-php/git/commits{/sha}","comments_url":"https://api.github.com/repos/pusher/pusher-http-php/comments{/number}","issue_comment_url":"https://api.github.com/repos/pusher/pusher-http-php/issues/comments{/number}","contents_url":"https://api.github.com/repos/pusher/pusher-http-php/contents/{+path}","compare_url":"https://api.github.com/repos/pusher/pusher-http-php/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pusher/pusher-http-php/merges","archive_url":"https://api.github.com/repos/pusher/pusher-http-php/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pusher/pusher-http-php/downloads","issues_url":"https://api.github.com/repos/pusher/pusher-http-php/issues{/number}","pulls_url":"https://api.github.com/repos/pusher/pusher-http-php/pulls{/number}","milestones_url":"https://api.github.com/repos/pusher/pusher-http-php/milestones{/number}","notifications_url":"https://api.github.com/repos/pusher/pusher-http-php/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pusher/pusher-http-php/labels{/name}","releases_url":"https://api.github.com/repos/pusher/pusher-http-php/releases{/id}","deployments_url":"https://api.github.com/repos/pusher/pusher-http-php/deployments","created_at":"2012-07-31T17:21:19Z","updated_at":"2016-04-12T11:25:55Z","pushed_at":"2016-04-13T00:28:55Z","git_url":"git://github.com/pusher/pusher-http-php.git","ssh_url":"git@github.com:pusher/pusher-http-php.git","clone_url":"https://github.com/pusher/pusher-http-php.git","svn_url":"https://github.com/pusher/pusher-http-php","homepage":"","size":530,"stargazers_count":295,"watchers_count":295,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":129,"mirror_url":null,"open_issues_count":15,"forks":129,"open_issues":15,"watchers":295,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pusher/pusher-http-php/pulls/98"},"html":{"href":"https://github.com/pusher/pusher-http-php/pull/98"},"issue":{"href":"https://api.github.com/repos/pusher/pusher-http-php/issues/98"},"comments":{"href":"https://api.github.com/repos/pusher/pusher-http-php/issues/98/comments"},"review_comments":{"href":"https://api.github.com/repos/pusher/pusher-http-php/pulls/98/comments"},"review_comment":{"href":"https://api.github.com/repos/pusher/pusher-http-php/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pusher/pusher-http-php/pulls/98/commits"},"statuses":{"href":"https://api.github.com/repos/pusher/pusher-http-php/statuses/1a32b0df9b18311571a76297b23c6e5173423979"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"zimbatm","id":3248,"avatar_url":"https://avatars.githubusercontent.com/u/3248?v=3","gravatar_id":"","url":"https://api.github.com/users/zimbatm","html_url":"https://github.com/zimbatm","followers_url":"https://api.github.com/users/zimbatm/followers","following_url":"https://api.github.com/users/zimbatm/following{/other_user}","gists_url":"https://api.github.com/users/zimbatm/gists{/gist_id}","starred_url":"https://api.github.com/users/zimbatm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zimbatm/subscriptions","organizations_url":"https://api.github.com/users/zimbatm/orgs","repos_url":"https://api.github.com/users/zimbatm/repos","events_url":"https://api.github.com/users/zimbatm/events{/privacy}","received_events_url":"https://api.github.com/users/zimbatm/received_events","type":"User","site_admin":false},"comments":2,"review_comments":0,"commits":3,"additions":0,"deletions":4,"changed_files":2}}