LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[Webdev] ? include ( was Re: Webdev digest, Vol 1 #386 - 6 msgs)

[Webdev] ? include ( was Re: Webdev digest, Vol 1 #386 - 6 msgs)

Donncha O Caoimh donncha.ocaoimh at tradesignals.com
Fri Dec 20 14:01:28 GMT 2002


Fastest way:
1. don't use array lookups, they're slower than using local variables in a 
function.
2. Create a string with the all the text you're going to print, then print 
that string.
3. Hash/Array indexes should ALWAYS be enclosed in quotes unless they're 
numerical indexes or constants. Why? because the current behaviour may go 
away in the future.. 
4. There's conflicting evidence that using ' is faster than " but that's not 
always true. It is faster to print "<td>".$var."</td>" than "<td>$var</td>" 
but the first method could be as fast as '<td>'.$var.'</td>' (see 
php.weblogs.com for a benchmark site posted some months ago)

Donncha.

On Friday 20 December 2002 13:45, Ken Guest wrote:
> Donncha O Caoimh wrote:
> >Actually, including files in PHP is relatively inexpensive and tests have
> >shown that including lots of files doesn't particularly slow down an
> >application, so I think it would help scale an application.
>
> On something related, which way does the best performance lie? Is the
> following quickest, or is it best to
> minimize the amount of times php code is (seperately) defined?
>
>         <TD><?php print $my_res[date]?></TD>
>         <TD><?php print $my_res[client]?>&nbsp;</TD>
>         <TD><?php print $my_res[ponum]?></TD>
>         <TD><?php print $my_res[ship]?>kwg</TD>
>
>
> k., thinking he really should know better about this
>



More information about the Webdev mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell