xref: /PHP-8.3/Zend/tests/bug40261.phpt (revision 610c7fbe)
1--TEST--
2Bug #40261 (Extremely slow data handling due to memory fragmentation)
3--INI--
4memory_limit=128M
5--FILE--
6<?php
7$num = 100000;
8
9$a = Array();
10for ($i=0; $i<$num; $i++) {
11  $a[$i] = Array(1);
12}
13
14for ($i=0; $i<$num; $i++) {
15  $b[$i] = $a[$i][0];
16}
17
18unset($a);
19for ($i=0; $i<$num; $i++) {
20  $b[$i] = "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890";
21}
22echo "ok\n";
23?>
24--EXPECT--
25ok
26