When using PHP When using PHP within an web environment, turning this option on has serious performance implications and is generally recommended for debugging purposes only.
In the above example, the output from echo() would be stored in the output buffer until ob_end_flush() was called. In the mean time, the call to setcookie() successfully stored a cookie without causing an error. (You can not normally send headers to the browser after data has already been sent.)