PhpTips.im - Everything about php - Download CMS, find tips and tricks, code snippetz, classes and more and more...
Bookmark this page !
   

Articles

    Home » Articles » Php Optimization Tips » Php code optimization tips
Published on : 06.05.2010 Category : Php Optimization Tips Viewed : 49 times.

Here are some tips and explanations about php code optimization.



  1. Use echo instead of print.

  2. Use single('') quotes instead of double(""). Double quotes search for variables in string.

  3. Declare static variables if possible.

  4. Use echo’s multiple parameters instead of string concatenation("." instad of ",").

  5. ++$i is faster than $i++.

  6. Define your variables, using static and global.

  7. Unset or null large variables.

  8. Use absolute paths in includes and requires.

  9. Use "else if" statements instead of "switch/case"

  10. Error suppression with @ is very slow.

  11. Use tags when declaring PHP as all other styles are depreciated, including short tags.



I will improve this list if I will find out new improvements.



Add this article in :

 

There is not yet any comment !



263 Rating: 0.0/10 (0 votes cast)

 

 Members
Log In !
Email Address :

Password :


Change my passowrd !
Sign Up !
We have : 3 members.
Latest member : albans
 
 Last Posts
 
 Advertising
 
©PhpTips.im 2010
Powered by PikaCMS.
Quick Links :
Home | Browse all articles | Downloads | Terms of Use
RSS RSS 2.0 : Articles | Downloads ATOM : Articles | Downloads