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