PHP has many different ways to print things, and I don't understand the difference between them. There are at least the following:
- stdout and stderr. These can be denoted as
php://stdoutandphp://stderr. There are also constantsSTDOUTandSTDERR, and I think these refer to the same thing. So far, so good; these are standard. php://output. What is this? Where does it go? Is it a synonym forphp://stdout, or something else? The docs say it writes "to the output buffer mechanism", but I don't know where the contents of this buffer go after that.printandecho. The docs say that these print tophp://output. They are both language constructs, but at a guess, the difference is thatprintis an expression, butechois a statement.printfand many friends. Do these all also go tophp://output?- Escaping. There are lots of alternative syntaxes for escaping, but I'm guessing they all have the same semantics. But what are the semantics? Where does the escaped text get printed to? Also to
php://output? Currently, I understand?>foo<?phpas syntactic sugar forecho 'foo';; is this correct?
Are there more ways of doing output? What exactly are the differences? What settings and environments affect their behavior?