{"comment":{"url":"https://api.github.com/repos/laravel/framework/comments/16283102","html_url":"https://github.com/laravel/framework/commit/64b0da186481cf48c4e92876c998f92e3277d1b1#commitcomment-16283102","id":16283102,"user":{"login":"OzanKurt","id":8682003,"avatar_url":"https://avatars.githubusercontent.com/u/8682003?v=3","gravatar_id":"","url":"https://api.github.com/users/OzanKurt","html_url":"https://github.com/OzanKurt","followers_url":"https://api.github.com/users/OzanKurt/followers","following_url":"https://api.github.com/users/OzanKurt/following{/other_user}","gists_url":"https://api.github.com/users/OzanKurt/gists{/gist_id}","starred_url":"https://api.github.com/users/OzanKurt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OzanKurt/subscriptions","organizations_url":"https://api.github.com/users/OzanKurt/orgs","repos_url":"https://api.github.com/users/OzanKurt/repos","events_url":"https://api.github.com/users/OzanKurt/events{/privacy}","received_events_url":"https://api.github.com/users/OzanKurt/received_events","type":"User","site_admin":false},"position":null,"line":null,"path":"","commit_id":"64b0da186481cf48c4e92876c998f92e3277d1b1","created_at":"2016-02-23T23:12:37Z","updated_at":"2016-02-23T23:12:37Z","body":"I don't know if it helps about performance but...\r\n\r\n```php\r\nif (func_num_args() == 2) {\r\n            $value = $operator;\r\n            $operator = '===';\r\n}\r\n```\r\n\r\nCould have been replaced with:\r\n\r\n\r\n```php\r\nif (is_null($value)) {\r\n            $value = $operator;\r\n            $operator = '===';\r\n}\r\n```\r\n\r\n<hr>\r\n\r\nAnd this:\r\n\r\n```php\r\nswitch ($operator) {\r\n                default:\r\n                case '=':\r\n                case '==':  return $retrieved == $value;\r\n                case '===': return $retrieved === $value;\r\n                case '<=':  return $retrieved <= $value;\r\n                case '>=':  return $retrieved >= $value;\r\n                case '<':   return $retrieved < $value;\r\n                case '>':   return $retrieved > $value;\r\n                case '<>':\r\n                case '!=':  return $retrieved != $value;\r\n                case '!==': return $retrieved !== $value;\r\n}\r\n```\r\n\r\n```php\r\n$operator = $operator == '=' ? '==' : $operator;\r\n\r\nreturn eval(\"$retrieved $operator $value\");\r\n```"}}