1 ); public function test($code) { $chck = self::REPORTS; error_log('-----'); error_log($code=="weeklySpending"?"TRUE":"FALSE"); error_log(array_key_exists(trim($code),$chck)?"TRUE":"FALSE"); error_log($chck["weeklySpending"]==1?"TRUE":"FALSE"); } } var_dump(ReportApi::test("weeklySpending"));