bug40809.phpt 565 B

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