title: How efficient is PHP's substr?
body: <p>I'm writing a parser in PHP which must be able to handle large in-memory strings, so this is a somewhat important issue. (ie, please don't "premature optimize" flame me, please)</p>
  
  <p>How does the <code>substr</code> function work? Does it make a second copy of the string data in memory, or does it reference the original? Should I worry about calling, for example, <code>$str = substr($str, 1);</code> in a loop?</p>