Skip to content

Instantly share code, notes, and snippets.

@mbrevda
Created February 21, 2013 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mbrevda/5004913 to your computer and use it in GitHub Desktop.
Save mbrevda/5004913 to your computer and use it in GitHub Desktop.
PHP concatenate vs implode test
time php -r 'ini_set("memory_limit", "2048M");$a=[];for($i=0;$i<1000000;$i++){$a[]=$i;}implode($a);'
time php -r 'ini_set("memory_limit", "2048M");$a="";for($i=0;$i<1000000;$i++){$a.=$i;}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment