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 #70713: Use After Free Vulnerability in array_walk()/array_walk_recursive() -..

Decoded Output download

--TEST--
Bug #70713: Use After Free Vulnerability in array_walk()/array_walk_recursive()
--FILE--
<?php

class obj
{
    function __tostring()
    {
        global $arr;

        $arr = 1;
        for ($i = 0; $i < 5; $i++) {
            $v[$i] = 'hi'.$i;
        }

        return 'hi';
    }
}

$arr = array('string' => new obj);

try {
    array_walk_recursive($arr, 'settype');
} catch (\TypeError $e) {
    echo $e->getMessage() . "
";
}

?>
--EXPECT--
Iterated value is no longer an array or object

Did this file decode correctly?

Original Code

--TEST--
Bug #70713: Use After Free Vulnerability in array_walk()/array_walk_recursive()
--FILE--
<?php

class obj
{
    function __tostring()
    {
        global $arr;

        $arr = 1;
        for ($i = 0; $i < 5; $i++) {
            $v[$i] = 'hi'.$i;
        }

        return 'hi';
    }
}

$arr = array('string' => new obj);

try {
    array_walk_recursive($arr, 'settype');
} catch (\TypeError $e) {
    echo $e->getMessage() . "\n";
}

?>
--EXPECT--
Iterated value is no longer an array or object

Function Calls

None

Variables

None

Stats

MD5 c7b7e3c8dd5d01a88a97f6cba1c3a3a7
Eval Count 0
Decode Time 83 ms