xref: /PHP-7.1/Zend/tests/bug76846.phpt (revision fa84b8eb)
1--TEST--
2Bug #76846: Segfault in shutdown function after memory limit error
3--INI--
4memory_limit=33M
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
14
15register_shutdown_function(function() {
16    new stdClass;
17});
18
19$ary = [];
20while (true) {
21    $ary[] = new stdClass;
22}
23
24?>
25--EXPECTF--
26Fatal error: Allowed memory size of %d bytes exhausted%s(tried to allocate %d bytes) in %s on line %d%A
27