Skip to content

Instantly share code, notes, and snippets.

@scips
Created August 27, 2013 14:57
Show Gist options
  • Save scips/6354668 to your computer and use it in GitHub Desktop.
Save scips/6354668 to your computer and use it in GitHub Desktop.
preg_replace vs str_replace
<?php
for ($i=0;$i<1000000;$i++) {preg_replace('/\-/','','test-test');}
<?php
for ($i=0;$i<1000000;$i++) {str_replace('-','','test-test');}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment