summaryrefslogtreecommitdiff
path: root/Zend/tests/concat_003.phpt
blob: dc22bae1a720665a1db2d62d1694e9f5e6239ac3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
--TEST--
Concatenating many small strings should not slowdown allocations
--SKIPIF--
<?php
if (PHP_DEBUG) { die ("skip debug version is slow"); }
if (getenv('SKIP_PERF_SENSITIVE')) die("skip performance sensitive test");
?>
--FILE--
<?php

$time = microtime(TRUE);

/* This might vary on Linux/Windows, so the worst case and also count in slow machines. */
$t_max = 1.0;

$datas = array_fill(0, 220000, [
    '000.000.000.000',
    '000.255.255.255',
    '保留地址',
    '保留地址',
    '保留地址',
    '保留地址',
    '保留地址',
    '保留地址',
]);

$time = microtime(TRUE);
$texts = '';
foreach ($datas AS $data)
{
    $texts .= implode("\t", $data) . "\r\n";
}

$t = microtime(TRUE) - $time;
var_dump($t < $t_max);

?>
+++DONE+++
--EXPECT--
bool(true)
+++DONE+++