Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

--TEST-- SPL: DoublyLinkedList: iterator modes --FILE-- <?php $dll = new SplDoublyLinkedLi..

Decoded Output download

--TEST--
SPL: DoublyLinkedList: iterator modes
--FILE--
<?php
$dll = new SplDoublyLinkedList();
$dll->push(2);
$dll->push(3);
$dll->push(4);

$dll->setIteratorMode(SplDoublyLinkedList::IT_MODE_LIFO);

foreach ($dll as $k => $v) {
    echo "$k=>$v
";
}

$dll->setIteratorMode(SplDoublyLinkedList::IT_MODE_FIFO);
foreach ($dll as $k => $v) {
    echo "$k=>$v
";
}

$dll->setIteratorMode(SplDoublyLinkedList::IT_MODE_FIFO | SplDoublyLinkedList::IT_MODE_DELETE);
var_dump($dll->count());
foreach ($dll as $k => $v) {
    echo "$k=>$v
";
}
var_dump($dll->count());

?>
--EXPECT--
2=>4
1=>3
0=>2
0=>2
1=>3
2=>4
int(3)
0=>2
0=>3
0=>4
int(0)

Did this file decode correctly?

Original Code

--TEST--
SPL: DoublyLinkedList: iterator modes
--FILE--
<?php
$dll = new SplDoublyLinkedList();
$dll->push(2);
$dll->push(3);
$dll->push(4);

$dll->setIteratorMode(SplDoublyLinkedList::IT_MODE_LIFO);

foreach ($dll as $k => $v) {
    echo "$k=>$v\n";
}

$dll->setIteratorMode(SplDoublyLinkedList::IT_MODE_FIFO);
foreach ($dll as $k => $v) {
    echo "$k=>$v\n";
}

$dll->setIteratorMode(SplDoublyLinkedList::IT_MODE_FIFO | SplDoublyLinkedList::IT_MODE_DELETE);
var_dump($dll->count());
foreach ($dll as $k => $v) {
    echo "$k=>$v\n";
}
var_dump($dll->count());

?>
--EXPECT--
2=>4
1=>3
0=>2
0=>2
1=>3
2=>4
int(3)
0=>2
0=>3
0=>4
int(0)

Function Calls

None

Variables

None

Stats

MD5 bc3950e678cc5ba280407f39a50ad8da
Eval Count 0
Decode Time 90 ms