xref: /PHP-8.2/ext/pcre/tests/bug73392.phpt (revision 73722df4)
1--TEST--
2Bug #73392 (A use-after-free in zend allocator management)
3--FILE--
4<?php
5class Rep {
6    public function __invoke() {
7        return "d";
8    }
9}
10class Foo {
11    public static function rep($rep) {
12        return "ok";
13    }
14}
15function b() {
16    return "b";
17}
18var_dump(
19    preg_replace_callback_array(
20        [
21            "/a/" => 'b',
22            "/b/" => function () {
23                return 'c';
24            },
25            "/c/" => new Rep(),
26            "reporting" => ["Foo", "rep"],
27            "a1" => ["Foo", "rep"],
28        ],
29        'a'
30    )
31);
32?>
33--EXPECTF--
34Warning: preg_replace_callback_array(): Delimiter must not be alphanumeric, backslash, or NUL byte in %sbug73392.php on line %d
35NULL
36