{"action":"closed","issue":{"url":"https://api.github.com/repos/cakephp/cakephp/issues/10862","repository_url":"https://api.github.com/repos/cakephp/cakephp","labels_url":"https://api.github.com/repos/cakephp/cakephp/issues/10862/labels{/name}","comments_url":"https://api.github.com/repos/cakephp/cakephp/issues/10862/comments","events_url":"https://api.github.com/repos/cakephp/cakephp/issues/10862/events","html_url":"https://github.com/cakephp/cakephp/issues/10862","id":240746114,"number":10862,"title":"PHP 7.2 has changed count's behavior causing problems with QueryCompiler","user":{"login":"MCF","id":223530,"avatar_url":"https://avatars1.githubusercontent.com/u/223530?v=3","gravatar_id":"","url":"https://api.github.com/users/MCF","html_url":"https://github.com/MCF","followers_url":"https://api.github.com/users/MCF/followers","following_url":"https://api.github.com/users/MCF/following{/other_user}","gists_url":"https://api.github.com/users/MCF/gists{/gist_id}","starred_url":"https://api.github.com/users/MCF/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MCF/subscriptions","organizations_url":"https://api.github.com/users/MCF/orgs","repos_url":"https://api.github.com/users/MCF/repos","events_url":"https://api.github.com/users/MCF/events{/privacy}","received_events_url":"https://api.github.com/users/MCF/received_events","type":"User","site_admin":false},"labels":[{"id":60504544,"url":"https://api.github.com/repos/cakephp/cakephp/labels/Defect","name":"Defect","color":"f7c6c7","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/cakephp/cakephp/milestones/136","html_url":"https://github.com/cakephp/cakephp/milestone/136","labels_url":"https://api.github.com/repos/cakephp/cakephp/milestones/136/labels","id":2603377,"number":136,"title":"3.4.10","description":"Bugfixes and small features for 3.4.","creator":{"login":"markstory","id":24086,"avatar_url":"https://avatars0.githubusercontent.com/u/24086?v=3","gravatar_id":"","url":"https://api.github.com/users/markstory","html_url":"https://github.com/markstory","followers_url":"https://api.github.com/users/markstory/followers","following_url":"https://api.github.com/users/markstory/following{/other_user}","gists_url":"https://api.github.com/users/markstory/gists{/gist_id}","starred_url":"https://api.github.com/users/markstory/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markstory/subscriptions","organizations_url":"https://api.github.com/users/markstory/orgs","repos_url":"https://api.github.com/users/markstory/repos","events_url":"https://api.github.com/users/markstory/events{/privacy}","received_events_url":"https://api.github.com/users/markstory/received_events","type":"User","site_admin":false},"open_issues":40,"closed_issues":12,"state":"open","created_at":"2017-06-26T02:04:18Z","updated_at":"2017-07-06T00:03:43Z","due_on":"2017-07-09T07:00:00Z","closed_at":null},"comments":1,"created_at":"2017-07-05T19:04:34Z","updated_at":"2017-07-06T00:03:43Z","closed_at":"2017-07-06T00:03:43Z","body":"This is a (multiple allowed):\r\n\r\n* [x] bug\r\n* [ ] enhancement\r\n* [ ] feature-discussion (RFC)\r\n\r\n* CakePHP Version: 3.4.8\r\n* Platform and Target: Windows 7 (but it will affect all platforms running PHP 7.2)\r\n\r\nPHP 7.2 has changed the behavior of count, it emits a warning if the object to be counted is not an array, or it does not implement the Countable interface:\r\n\r\nhttps://wiki.php.net/rfc/counting_non_countables\r\n\r\nAs a result the _sqlCompiler created function in the QueryBuilder now emits many warnings.  This line is the problem:\r\n\r\nhttps://github.com/cakephp/cakephp/blob/master/src/Database/QueryCompiler.php#L128\r\n\r\nThe `$parts` variable can be many different things, including non-arrays and objects not implementing the Countable interface (for example instances of Cake\\Database\\Expression\\ValuesExpression), and many different warnings will result during normal operations.\r\n\r\nI presume that in future versions of PHP the old count behavior of returning 1 for non-arrays and non-Countable objects will be removed, so this should be fixed for that reason as well."}}
{"actor":{"display_login":"markstory"}}