In the example given, the header does exactly nothing, which is exactly the point.
HTTP headers starting with X-
are precisely not standardized, so anyone can set such a header knowing that it doesn't mean anything specific. The point in the case you cite is simply to use the header
function to set the response code. To do that, some header needs to be supplied. The user chose to use the otherwise meaningless header X-PHP-Response-Code
, simply to be able to give some header to header()
in order to use its third argument to set the response code.
In other words: it's a hack.