Re: Using a single php entry file for a whole site. [message #181878 is a reply to message #181876] |
Thu, 20 June 2013 22:50 |
Christoph Michael Bec
Messages: 207 Registered: June 2013
Karma:
|
Senior Member |
|
|
Am 21.06.2013 00:33, schrieb Marc van Lieshout:
> Why is using ob_start() poor programming?
> The pair ob_start/ob_get_clean captures the contents of the page in the
> $contents variable.
This discussion may well end in a flame war. What is faster: echoing
with output buffering vs. concatening strings with the dot operator?
ISTM all depends on the implementation. AFAIK string concatenation is a
very cheap operation in Python, for instance, as the string is not
actually built (merely a "pseudo" string containing links to the
concatenated strings). In other languages such as PHP, the characters
have to be copied over to a new string, AFAIK. This probably makes
output buffering faster, but the performance difference may be
neglectable for typical cases. And one never knows, if the
implementation might change in the future.
--
Christoph M. Becker
|
|
|