xref: /PHP-7.2/Zend/tests/concat_003.phpt (revision 432660f7)
1--TEST--
2Concatenating 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
8$time = microtime(TRUE);
9
10/* This might vary on Linux/Windows, so the worst case and also count in slow machines. */
11$t_max = 1.0;
12
13$datas = array_fill(0, 220000, [
14    '000.000.000.000',
15    '000.255.255.255',
16    '保留地址',
17    '保留地址',
18    '保留地址',
19    '保留地址',
20    '保留地址',
21    '保留地址',
22]);
23
24$time = microtime(TRUE);
25$texts = '';
26foreach ($datas AS $data)
27{
28    $texts .= implode("\t", $data) . "\r\n";
29}
30
31$t = microtime(TRUE) - $time;
32var_dump($t < $t_max);
33
34?>
35+++DONE+++
36--EXPECT--
37bool(true)
38+++DONE+++
39