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-- Bug #53071 (Usage of SPLObjectStorage defeats gc_collect_cycles) --FILE-- <?php g..

Decoded Output download

--TEST--
Bug #53071 (Usage of SPLObjectStorage defeats gc_collect_cycles)
--FILE--
<?php
gc_enable();
class myClass
{
    public $member;
}
function LimitedScope()
{
    $myA = new myClass();
    $myB = new SplObjectStorage();
    $myC = new myClass();
    $myC->member = $myA; // myC has a reference to myA
    $myB->Attach($myC);  // myB attaches myC
    $myA->member = $myB; // myA has myB, comleting the cycle
}
LimitedScope();
var_dump(gc_collect_cycles());

echo "Done.
";

?>
--EXPECT--
int(3)
Done.

Did this file decode correctly?

Original Code

--TEST--
Bug #53071 (Usage of SPLObjectStorage defeats gc_collect_cycles)
--FILE--
<?php
gc_enable();
class myClass
{
    public $member;
}
function LimitedScope()
{
    $myA = new myClass();
    $myB = new SplObjectStorage();
    $myC = new myClass();
    $myC->member = $myA; // myC has a reference to myA
    $myB->Attach($myC);  // myB attaches myC
    $myA->member = $myB; // myA has myB, comleting the cycle
}
LimitedScope();
var_dump(gc_collect_cycles());

echo "Done.\n";

?>
--EXPECT--
int(3)
Done.

Function Calls

gc_enable 1

Variables

None

Stats

MD5 227e50fefa6443a038c0738fdcea54ae
Eval Count 0
Decode Time 86 ms