diff options
Diffstat (limited to 'Zend/tests/concat_003.phpt')
-rw-r--r-- | Zend/tests/concat_003.phpt | 42 |
1 files changed, 14 insertions, 28 deletions
diff --git a/Zend/tests/concat_003.phpt b/Zend/tests/concat_003.phpt index 53d8d2f9a4..13c6fdc087 100644 --- a/Zend/tests/concat_003.phpt +++ b/Zend/tests/concat_003.phpt @@ -2,37 +2,24 @@ Concatenating many small strings should not slowdown allocations --SKIPIF-- <?php if (PHP_DEBUG) { die ("skip debug version is slow"); } ?> ---INI-- -memory_limit=256m --FILE-- <?php -/* To note is that memory usage can vary depending on whether opcache is on. The actual - measuring that matters is timing here. */ - $time = microtime(TRUE); /* This might vary on Linux/Windows, so the worst case and also count in slow machines. */ -$t0_max = 0.3; -$t1_max = 1.0; - -$datas = []; -for ($i = 0; $i < 220000; $i++) -{ - $datas[] = [ - '000.000.000.000', - '000.255.255.255', - '保留地址', - '保留地址', - '保留地址', - '保留地址', - '保留地址', - '保留地址', - ]; -} - -$t0 = microtime(TRUE) - $time; -var_dump($t0 < $t0_max); +$t_max = 1.0; + +$datas = array_fill(0, 220000, [ + '000.000.000.000', + '000.255.255.255', + '保留地址', + '保留地址', + '保留地址', + '保留地址', + '保留地址', + '保留地址', +]); $time = microtime(TRUE); $texts = ''; @@ -41,12 +28,11 @@ foreach ($datas AS $data) $texts .= implode("\t", $data) . "\r\n"; } -$t1 = microtime(TRUE) - $time; -var_dump($t1 < $t1_max); +$t = microtime(TRUE) - $time; +var_dump($t < $t_max); ?> +++DONE+++ --EXPECT-- bool(true) -bool(true) +++DONE+++ |