bug40809.phpt 533 B

1234567891011121314151617181920212223242526272829303132
  1. --TEST--
  2. Bug #40809 (Poor performance of ".=")
  3. --FILE--
  4. <?php
  5. $num_increments = 100;
  6. $num_repeats = 1000;
  7. $increment = 50;
  8. /* Create some more holes to give the memory allocator something to
  9. * work with. */
  10. $num = 5000;
  11. $a = Array();
  12. for ($i=0; $i<$num; $i++) {
  13. $a[$i] = Array(1);
  14. }
  15. for ($i=0; $i<$num; $i++) {
  16. $b[$i] = $a[$i][0];
  17. }
  18. unset($a);
  19. for ($i=0;$i<$num_repeats;$i++) {
  20. $evil = "";
  21. for ($j=0;$j<$num_increments;$j++) {
  22. $evil .= str_repeat("a", $increment);
  23. }
  24. unset($evil);
  25. }
  26. echo "ok\n";
  27. ?>
  28. --EXPECT--
  29. ok