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-- preg_replace_callback() should not leak persistent memory on fatal error --FILE--..

Decoded Output download

--TEST--
preg_replace_callback() should not leak persistent memory on fatal error
--FILE--
<?php

function test() {}

preg_replace_callback('/a/', function($matches) {
    preg_replace_callback('/x/', function($matches) {
        function test() {} // Trigger a fatal error.
        return 'y';
    }, 'x');
    return 'b';
}, 'a');

?>
--EXPECTF--
Fatal error: Cannot redeclare test() (previously declared in %s on line %d

Did this file decode correctly?

Original Code

--TEST--
preg_replace_callback() should not leak persistent memory on fatal error
--FILE--
<?php

function test() {}

preg_replace_callback('/a/', function($matches) {
    preg_replace_callback('/x/', function($matches) {
        function test() {} // Trigger a fatal error.
        return 'y';
    }, 'x');
    return 'b';
}, 'a');

?>
--EXPECTF--
Fatal error: Cannot redeclare test() (previously declared in %s on line %d

Function Calls

None

Variables

None

Stats

MD5 ec9f6af2e6bc06152311101f42b11ebe
Eval Count 0
Decode Time 71 ms