1--TEST--
2preg_replace_callback() should not leak persistent memory on fatal error
3--FILE--
4<?php
5
6function test() {}
7
8preg_replace_callback('/a/', function($matches) {
9    preg_replace_callback('/x/', function($matches) {
10        function test() {} // Trigger a fatal error.
11        return 'y';
12    }, 'x');
13    return 'b';
14}, 'a');
15
16?>
17--EXPECTF--
18Fatal error: Cannot redeclare function test() (previously declared in %s:%d) in %s on line %d
19