Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2012
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. [stanis@home ~] % cat a.php [3:08:57]
  2. <?php
  3.  
  4. $str = "something'that'should'be'escaped'";
  5. $starttime = microtime(true);
  6. for($i=0; $i<10000000; $i++) {
  7. $a = base64_encode($str);
  8. }
  9. echo $a, "\n";
  10. echo ((microtime(true)) - $starttime), "\n";
  11. $starttime = microtime(true);
  12. for($i=0; $i<10000000; $i++) {
  13. $a = addslashes($str);
  14. }
  15. echo $a, "\n";
  16. echo ((microtime(true)) - $starttime), "\n";
  17. [stanis@home ~] % php a.php [3:09:05]
  18. c29tZXRoaW5nJ3RoYXQnc2hvdWxkJ2JlJ2VzY2FwZWQn
  19. 1.6811218261719
  20. something\'that\'should\'be\'escaped\'
  21. 1.9145817756653
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement