Re: here doc performance

From: Date: Sat, 07 Apr 2001 07:23:17 +0000
Subject: Re: here doc performance
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-47552@lists.php.net to get a copy of this message
I'm sorry, I was mistaken. I was thinking that it did not perform variable interpolation for some reason, but of course in fact it does. So switch my comment around to say that here doc is about as fast as double quotes. I'd test it with microtime, but on windows the "it finished before it started" bug prevents me from it :) -- Plutarck Should be working on something... ...but forgot what it was. ""Jack Dempsey"" <dempsejn@georgetown.edu> wrote in message news:NEBBKBGAMLPMIDAJEALPKEMECGAA.dempsejn@georgetown.edu... > Thanks for your thoughts. I don't believe it can be as fast as single > quotes, simply because it does variable interpolation, and that's why > printing doubly quoted strings are slower than singles, hence i would think > here docs would be slower as well...but nothing so great that i would to > worry about.... > anyone else? is a big here doc the "fastest" way to print out a lot of html > with variables? > > > > -----Original Message----- > From: Plutarck [mailto:aemuli@spamclause-yahoo.com] > Sent: Saturday, April 07, 2001 2:31 AM > To: php-general@lists.php.net > Subject: Re: [PHP] here doc performance > > > To my knowledge, though I haven't done any testing with microtime, heredoc > is as faster as using single quotes. > > Since the only thing PHP looks for is the characters that were present at > the very begining on the string, there should certainly be no slowdowns at > all. > > If it's not that way, I imagine it would be just a bad implementation which > will be fixed soon. But I strongly doubt a bad implementation of here doc > printing was made. > > > -- > Plutarck > Should be working on something... > ...but forgot what it was. > > > ""Jack Dempsey"" <dempsejn@georgetown.edu> wrote in message > news:NEBBKBGAMLPMIDAJEALPKEMACGAA.dempsejn@georgetown.edu... > > Hi all, > > > > I use the here doc option heavily in pages i create, outputting large > chunks > > of HTML with variables inside the echo<<<EOF ...... EOF; syntax...is there > a > > better way to do this? I'm wondering if anyone knows of running times for > > things like that...i would think that it'd be better than going back and > > forth between php and html (certainly easier), wouldn't have to escape the > > quotes like you would if you used > > echo " > > > > lots of html > > ... > > > > "; > > > > Any thoughts on this? > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > > For additional commands, e-mail: php-general-help@lists.php.net > > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#47552) next »