Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [stanis@home ~] % cat a.php [3:08:57]
- <?php
- $str = "something'that'should'be'escaped'";
- $starttime = microtime(true);
- for($i=0; $i<10000000; $i++) {
- $a = base64_encode($str);
- }
- echo $a, "\n";
- echo ((microtime(true)) - $starttime), "\n";
- $starttime = microtime(true);
- for($i=0; $i<10000000; $i++) {
- $a = addslashes($str);
- }
- echo $a, "\n";
- echo ((microtime(true)) - $starttime), "\n";
- [stanis@home ~] % php a.php [3:09:05]
- c29tZXRoaW5nJ3RoYXQnc2hvdWxkJ2JlJ2VzY2FwZWQn
- 1.6811218261719
- something\'that\'should\'be\'escaped\'
- 1.9145817756653
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement