fixes for HHVM - changes algos to constants (integers) and casts apache_request_headers to array