File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / Zend / tests / bug40809.phpt
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Feb 21 23:47:52 2012 UTC (13 years, 1 month ago) by misho
Branches: php, MAIN
CVS tags: v5_4_3elwix, v5_4_29p0, v5_4_29, v5_4_20p0, v5_4_20, v5_4_17p0, v5_4_17, v5_3_10, HEAD
php

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

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>