xref: /PHP-8.2/Zend/tests/bug70258.phpt (revision c5401854)
1--TEST--
2Bug #70258 (Segfault if do_resize fails to allocated memory)
3--INI--
4memory_limit=2M
5--SKIPIF--
6<?php
7$zend_mm_enabled = getenv("USE_ZEND_ALLOC");
8if ($zend_mm_enabled === "0") {
9    die("skip Zend MM disabled");
10}
11?>
12--FILE--
13<?php
14class A {
15    public $arr;
16    public function core() {
17        $this->arr["no_pack"] = 1;
18        while (1) {
19            $this->arr[] = 1;
20        }
21    }
22}
23
24$a = new A;
25$a->core();
26?>
27--EXPECTF--
28Fatal error: Allowed memory size of 2097152 bytes exhausted%s(tried to allocate %d bytes) in %s on line %d
29