concat_003.phpt 716 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. --TEST--
  2. Concatenating many small strings should not slowdown allocations
  3. --SKIPIF--
  4. <?php if (PHP_DEBUG) { die ("skip debug version is slow"); } ?>
  5. --FILE--
  6. <?php
  7. $time = microtime(TRUE);
  8. /* This might vary on Linux/Windows, so the worst case and also count in slow machines. */
  9. $t_max = 1.0;
  10. $datas = array_fill(0, 220000, [
  11. '000.000.000.000',
  12. '000.255.255.255',
  13. '保留地址',
  14. '保留地址',
  15. '保留地址',
  16. '保留地址',
  17. '保留地址',
  18. '保留地址',
  19. ]);
  20. $time = microtime(TRUE);
  21. $texts = '';
  22. foreach ($datas AS $data)
  23. {
  24. $texts .= implode("\t", $data) . "\r\n";
  25. }
  26. $t = microtime(TRUE) - $time;
  27. var_dump($t < $t_max);
  28. ?>
  29. +++DONE+++
  30. --EXPECT--
  31. bool(true)
  32. +++DONE+++