xref: /PHP-8.4/Zend/tests/bug79836_4.phpt (revision 7790ee87)
1--TEST--
2Bug #79836 (use-after-free in concat_function)
3--INI--
4memory_limit=10M
5--FILE--
6<?php
7class Foo {
8    public function __toString() {
9        return str_repeat('a', 10);
10    }
11}
12
13$i = str_repeat('a', 5 * 1024 * 1024);
14$e = new Foo();
15$e .= $i;
16?>
17--EXPECTF--
18Fatal error: Allowed memory size of %d bytes exhausted%s(tried to allocate %d bytes) in %s on line %d
19