Re: [SMARTY] Re: Bugfixes and some other stuff...

From: Date: Mon, 15 Jul 2002 19:36:00 +0000
Subject: Re: [SMARTY] Re: Bugfixes and some other stuff...
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-5321@lists.php.net to get a copy of this message
Not really. What to do with single or double quotes (treat less or more literally) is determined in the PHP compiler. When the script executes, it is already compiled, so you won't see any difference between echo "test" and echo 'test'. It should, however, affect the compilation speed, but then, you'd need scripts containing some hundreds of thousands instructions containg the different quotes to see a markably difference (didn't test it, though ;) >won't it be even faster if you had: > >echo 'This is a test: ' . $string . "\n"; > >-----Original Message----- >From: Monte Ohrt [mailto:monte@ispi.net] >Sent: July 14, 2002 12:41 PM >To: Andrei Zmievski >Cc: Norbert Röcher; smarty-general@lists.php.net >Subject: Re: [SMARTY] Re: Bugfixes and some other stuff... > > >Simple test: > >$string = "test me"; >echo "This is a test: " . $string . "\n"; --> repeated 100000 times, >1.768 seconds >echo "This is a test: $string\n"; --> repeated 100000 times, 3.294 seconds > >Andrei Zmievski wrote: > >>On Sun, 14 Jul 2002, Norbert Röcher wrote: >> >> >>>Writing something like: >>>echo 'test: '.$test; >>>is about 10% slower than >>>echo "test: $test"; >>> >>>So this can't be said generally. >>> >>> >> >>Eh, no. In the first scenario PHP does not have to interpolate variables >>inside the string, so it is faster than the second one. >> >>-Andrei http://www.gravitonic.com/ >>* The future is not what it used to be. * >> >> >> > > > > >-- >Smarty General Mailing List (http://smarty.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php > > > > >-- >Smarty General Mailing List (http://smarty.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.smarty.general (#5321) next »