More specifically, can the block of code
ob_start();
echo $astring;
$astring = ob_get_clean();
change the value of $astring ? In other words, I want to know how reliable is the combination of echo, output-buffering and getting the buffer. Of course, I have tested it. With simple strings, in my tests, the string stays the same. I want to know if I can rely on this being always the case. Is there any possible exception? What could make a difference is the occurrence of special escape characters in the string, things like that.
This is a paste and cut of a comment made by axiac: The output buffer is nothing else than a hidden string variable. It is as reliable as any other string variable to hold any amount of text, limited by the memory_limit php.ini configuration (minus other data your script creates and the internal PHP structures for memory management) and the amount of memory available on the computer (which is virtually unlimited due to paging).