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 #36825 (Exceptions thrown in ArrayObject::offsetGet cause segfault) --FILE-- ..

Decoded Output download

--TEST--
Bug #36825 (Exceptions thrown in ArrayObject::offsetGet cause segfault)
--FILE--
<?php

class foo extends ArrayObject
{
    public function offsetGet($key): mixed
    {
        echo __METHOD__ . "($key)
";
        throw new Exception("hi");
    }
}

$test = new foo();

try
{
    var_dump($test['bar']);
}
catch (Exception $e)
{
    echo "got exception
";
}

?>
--EXPECT--
foo::offsetGet(bar)
got exception

Did this file decode correctly?

Original Code

--TEST--
Bug #36825 (Exceptions thrown in ArrayObject::offsetGet cause segfault)
--FILE--
<?php

class foo extends ArrayObject
{
    public function offsetGet($key): mixed
    {
        echo __METHOD__ . "($key)\n";
        throw new Exception("hi");
    }
}

$test = new foo();

try
{
    var_dump($test['bar']);
}
catch (Exception $e)
{
    echo "got exception\n";
}

?>
--EXPECT--
foo::offsetGet(bar)
got exception

Function Calls

None

Variables

None

Stats

MD5 8e08691e8fb2ff575c09dcf1c6189596
Eval Count 0
Decode Time 82 ms