I believe the Location header sets the 302 header for you. You should not try and set another header if you are doing a location command. This may be a PHP bug, as I know I have encountered it in the past.
The second special case is the "Location:" header. Not only does it send this header back to the browser, but it also returns a REDIRECT (302) status code to the browser unless some 3xx status code has already been set.
The discussion on php.net about the header function suggested setting the status code in the way I have done, but it doesn't look good.