code_junkie

How efficient is define in PHP?

Nov 11th, 2011
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. define("SETTING", 0);
  2. $something = SETTING;
  3.  
  4. $setting = 0;
  5. $something = $setting;
  6.  
  7. php > $cat='';$f=microtime(1);$s='cowcow45';$i=9000;while ($i--){$cat.='plip'.$s.'cow';}echo microtime(1)-$f."n";
  8.  
  9. php > $cat='';$f=microtime(1);define('s','cowcow45');$i=9000;while ($i--){$cat.='plip'.s.'cow';}echo microtime(1)-$f."n";
Add Comment
Please, Sign In to add comment