String construction
| From: | Jon Parise | Date: | Sun, 20 Aug 2000 21:39:16 +0000 |
| Subject: | String construction | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-12676@lists.php.net to get a copy of this message | ||
Is there any appreciable performance different between:
a) $new_string = 'literal "' . $variable . '" literal';
... and ...
b) $new_string = sprintf('literal "%s" literal', $variable);
I find the second method far more readable when looking at a complex
concatenation, but I'm curious whether it's much slower or more
resource intensive than the (perceivably) simpler dot concatenation.
--
Jon Parise (jon@csh.rit.edu) . Rochester Inst. of Technology
http://www.csh.rit.edu/~jon/ : Computer Science House
Member