title: Seriously, should I write bad PHP code?
body: <p>I'm doing some PHP work recently, and in all the code I've seen, people tend to use few methods. (They also tend to use few variables, but that's another issue.) I was wondering why this is, and I found this note "A function call with one parameter and an empty function body takes about the same time as doing 7-8 $localvar++ operations. A similar method call is of course about 15 $localvar++ operations" <a href="http://reinholdweber.com/?p=3" rel="nofollow noreferrer">here</a>. </p>
  
  <p>Is this true, even when the PHP page has been compiled and cached? Should I avoid using methods as much as possible for efficiency? I like to write well-organized, human-readable code with methods wherever a code block would be repeated. If it is necessary to write flat code without methods, are there any programs that will "inline" method bodies? That way I could write nice code and then ugly it up before deployment.</p>
  
  <p>By the way, the code I've been looking at is from the Joomla 1.5 core and several WordPress plugins, so I assume they are people who know what they're doing.</p>
  
  <p><strong>Note:</strong> I'm pleased that everyone has jumped on this question to talk about optimization <strong>in general</strong>, but in fact we're talking about optimization in interpreted languages. At least some hint of the fact that we're talking about PHP would be nice.</p>