xref: /PHP-8.2/Zend/tests/oss_fuzz_54325.phpt (revision ea52706a)
1--TEST--
2oss-fuzz #54325: Fix use-after-free of name in var-var with malicious error handler
3--FILE--
4<?php
5set_error_handler(function ($errno, $errstr) {
6    var_dump($errstr);
7    global $x;
8    $x = new stdClass;
9});
10
11// Needs to be non-interned string
12$x = strrev('foo');
13$$x++;
14var_dump($x);
15?>
16--EXPECT--
17string(23) "Undefined variable $oof"
18object(stdClass)#2 (0) {
19}
20