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: SplMaxHeap: std operations --FILE-- <?php $h = new SplMaxHeap(); // errors ..

Decoded Output download

--TEST--
SPL: SplMaxHeap: std operations
--FILE--
<?php
$h = new SplMaxHeap();

// errors
try {
    $h->extract();
} catch (RuntimeException $e) {
    echo "Exception: ".$e->getMessage()."
";
}


$h->insert(1);
$h->insert(2);
$h->insert(3);
$h->insert(3);
$h->insert(3);

echo $h->count()."
";
echo $h->extract()."
";
echo $h->extract()."
";
echo $h->extract()."
";
echo $h->extract()."
";
echo $h->extract()."
";
echo $h->count()."
";

echo "--
";

$b = 4;
$h->insert($b);
$b = 5;

$h2 = clone $h;
echo $h->extract()."
";
echo $h2->extract()."
";
?>
--EXPECT--
Exception: Can't extract from an empty heap
5
3
3
3
2
1
0
--
4
4

Did this file decode correctly?

Original Code

--TEST--
SPL: SplMaxHeap: std operations
--FILE--
<?php
$h = new SplMaxHeap();

// errors
try {
    $h->extract();
} catch (RuntimeException $e) {
    echo "Exception: ".$e->getMessage()."\n";
}


$h->insert(1);
$h->insert(2);
$h->insert(3);
$h->insert(3);
$h->insert(3);

echo $h->count()."\n";
echo $h->extract()."\n";
echo $h->extract()."\n";
echo $h->extract()."\n";
echo $h->extract()."\n";
echo $h->extract()."\n";
echo $h->count()."\n";

echo "--\n";

$b = 4;
$h->insert($b);
$b = 5;

$h2 = clone $h;
echo $h->extract()."\n";
echo $h2->extract()."\n";
?>
--EXPECT--
Exception: Can't extract from an empty heap
5
3
3
3
2
1
0
--
4
4

Function Calls

None

Variables

None

Stats

MD5 ed65c218eba2a002c56dc800058396fe
Eval Count 0
Decode Time 101 ms