{"action":"created","issue":{"url":"https://api.github.com/repos/cakephp/cakephp/issues/8632","repository_url":"https://api.github.com/repos/cakephp/cakephp","labels_url":"https://api.github.com/repos/cakephp/cakephp/issues/8632/labels{/name}","comments_url":"https://api.github.com/repos/cakephp/cakephp/issues/8632/comments","events_url":"https://api.github.com/repos/cakephp/cakephp/issues/8632/events","html_url":"https://github.com/cakephp/cakephp/issues/8632","id":147784323,"number":8632,"title":"Hash::contains should return true for empty needle","user":{"login":"nrother","id":6770775,"avatar_url":"https://avatars.githubusercontent.com/u/6770775?v=3","gravatar_id":"","url":"https://api.github.com/users/nrother","html_url":"https://github.com/nrother","followers_url":"https://api.github.com/users/nrother/followers","following_url":"https://api.github.com/users/nrother/following{/other_user}","gists_url":"https://api.github.com/users/nrother/gists{/gist_id}","starred_url":"https://api.github.com/users/nrother/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nrother/subscriptions","organizations_url":"https://api.github.com/users/nrother/orgs","repos_url":"https://api.github.com/users/nrother/repos","events_url":"https://api.github.com/users/nrother/events{/privacy}","received_events_url":"https://api.github.com/users/nrother/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/cakephp/cakephp/labels/utility","name":"utility","color":"ffffff"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/cakephp/cakephp/milestones/87","html_url":"https://github.com/cakephp/cakephp/milestones/3.2.8","labels_url":"https://api.github.com/repos/cakephp/cakephp/milestones/87/labels","id":1699165,"number":87,"title":"3.2.8","description":"Bugfixes, optimizations and minor features for 3.2.x","creator":{"login":"markstory","id":24086,"avatar_url":"https://avatars.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":33,"closed_issues":8,"state":"open","created_at":"2016-04-11T23:40:37Z","updated_at":"2016-04-13T13:32:00Z","due_on":"2016-05-08T04:00:00Z","closed_at":null},"comments":5,"created_at":"2016-04-12T15:17:55Z","updated_at":"2016-04-13T14:25:18Z","closed_at":null,"body":"```php\r\nHash::contains(['a'], []); //false\r\nHash::contains([], []); //false\r\n```\r\n\r\nThis is contradictory to the mathematical definition to a subset. I currently don't see a reason why `contains` should work this way. (This bug might exist due to a mixup of `&&` and `||` [here](https://github.com/cakephp/cakephp/blob/master/src/Utility/Hash.php#L554))"},"comment":{"url":"https://api.github.com/repos/cakephp/cakephp/issues/comments/209472953","html_url":"https://github.com/cakephp/cakephp/issues/8632#issuecomment-209472953","issue_url":"https://api.github.com/repos/cakephp/cakephp/issues/8632","id":209472953,"user":{"login":"nrother","id":6770775,"avatar_url":"https://avatars.githubusercontent.com/u/6770775?v=3","gravatar_id":"","url":"https://api.github.com/users/nrother","html_url":"https://github.com/nrother","followers_url":"https://api.github.com/users/nrother/followers","following_url":"https://api.github.com/users/nrother/following{/other_user}","gists_url":"https://api.github.com/users/nrother/gists{/gist_id}","starred_url":"https://api.github.com/users/nrother/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nrother/subscriptions","organizations_url":"https://api.github.com/users/nrother/orgs","repos_url":"https://api.github.com/users/nrother/repos","events_url":"https://api.github.com/users/nrother/events{/privacy}","received_events_url":"https://api.github.com/users/nrother/received_events","type":"User","site_admin":false},"created_at":"2016-04-13T14:25:18Z","updated_at":"2016-04-13T14:25:18Z","body":"I tried to use this code to detect if one user has all rights another user has, and this failed, when the first user did not had any rights. I found this very confusing. I might be interesting to find out how often this method is really called with `[]` for the second parameter and someone is really expecting this to return false. But this might be just me, as I'm from a kind-of-mathematical background.\r\n\r\nI'd vote (at least) for a `strict` parameter."}}