php  IHDRwQ)Ba pHYs  sRGBgAMA aIDATxMk\Us&uo,mD )Xw+e?tw.oWp;QHZnw`gaiJ9̟灙a=nl[ ʨG;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$y H@E7j 1j+OFRg}ܫ;@Ea~ j`u'o> j-$_q?qSXzG'ay

PAL.C.T MINI SHELL
files >> /php-7.1.11/ext/spl/tests/
upload
files >> //php-7.1.11/ext/spl/tests/heap_009.phpt

--TEST--
SPL: SplHeap and friends, throw: An iterator cannot be used with foreach by reference
--CREDITS--
Thomas Koch <thomas@koch.ro>
#Hackday Webtuesday 2008-05-24
--FILE--
<?php
function testForException( $heap )
{
    try
    {
        foreach( $heap as &$item );
    }
    catch( RuntimeException $e )
    {
        echo $e->getMessage(),"\n";
    }
}

// 1. SplMinHeap emtpy
$heap = new SplMinHeap;
testForException( $heap );

// 2. SplMinHeap non-emtpy
$heap = new SplMinHeap;
$heap->insert( 1 );
testForException( $heap );

// 3. SplMaxHeap emtpy
$heap = new SplMaxHeap;
testForException( $heap );

// 4. SplMaxHeap non-emtpy
$heap = new SplMaxHeap;
$heap->insert( 1 );
testForException( $heap );

// 5. SplPriorityQueue empty
$heap = new SplPriorityQueue;
testForException( $heap );

// 6. SplPriorityQueue non-empty
$heap = new SplPriorityQueue;
$heap->insert( 1, 2 );
testForException( $heap );

?>
==DONE==
--EXPECT--
An iterator cannot be used with foreach by reference
An iterator cannot be used with foreach by reference
An iterator cannot be used with foreach by reference
An iterator cannot be used with foreach by reference
An iterator cannot be used with foreach by reference
An iterator cannot be used with foreach by reference
==DONE==
y~or5J={Eeu磝QkᯘG{?+]ן?wM3X^歌>{7پK>on\jyR g/=fOroNVv~Y+NGuÝHWyw[eQʨSb>>}Gmx[o[<{Ϯ_qF vMIENDB`