Most unexpected question was:
echo $name;
loop {
if( $name = 'blabla' ){
header("authorized");
}
}
appears a bug, saying "headers already sent". luckily i was experience in this field :)
Headers already sent previously by the server to output the name before loop, the all headers should be sent prior to output.
How to prevent ?
Dont echo name, or, if you can not change - use ob_start(), ob_end_flush() to buffer the outputs. THe next question came up is Why ob_*, if you can force server to push always buffered ? - Force server to always buffer is a wrong way, you not always going to need the buffer, so that OB_* making possible to buffer only when you need.