Annotation of embedaddon/php/Zend/tests/bug37715.phpt, revision 1.1

1.1     ! misho       1: --TEST--
        !             2: Bug #37715 (array pointers resetting on copy)
        !             3: --FILE--
        !             4: <?php
        !             5: $a = array(
        !             6:     'a' => array(
        !             7:         'A', 'B', 'C', 'D',
        !             8:     ),
        !             9:     'b' => array(
        !            10:         'AA', 'BB', 'CC', 'DD',
        !            11:     ),
        !            12: );
        !            13: 
        !            14: // Set the pointer of $a to 'b' and the pointer of 'b' to 'CC'
        !            15: reset($a);
        !            16: next($a);
        !            17: next($a['b']);
        !            18: next($a['b']);
        !            19: next($a['b']);
        !            20: 
        !            21: var_dump(key($a['b']));
        !            22: foreach($a as $k => $d)
        !            23: {
        !            24: }
        !            25: // Alternatively $c = $a; and foreachloop removal will cause identical results.
        !            26: var_dump(key($a['b']));
        !            27: --EXPECT--
        !            28: int(3)
        !            29: int(3)

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