Advertisement
Guest User

Untitled

a guest
May 3rd, 2018
264
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.42 KB | None | 0 0
  1. <?php
  2.  
  3. DEFINE('LIMIT', 1000000);
  4.  
  5. $world = "World";
  6.  
  7. $start = microtime();
  8.  
  9. for ($i = 0; $i < LIMIT; $i++) {
  10.  $s = 'Hello, '.$world.', how are you?';
  11. }
  12.  
  13. $took = microtime() - $start;
  14. echo("String append took [{$took}]\r\n");
  15.  
  16. $start = microtime();
  17.  
  18. for ($i = 0; $i < LIMIT; $i++) {
  19.  $s = 'Hello, {$world}, how are you?';
  20. }
  21.  
  22. $took = microtime() - $start;
  23. echo("Complex string syntax took [{$took}]\r\n");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement