1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00
Files
archived-php-src/Zend/tests/gh12073.phpt
Shivam Mathur ac15486ae0 Fix CI for windows-2022
This is a continuation of GH-18927 to fix CI for windows-2022
2025-06-25 03:20:49 +05:30

32 lines
663 B
PHP

--TEST--
GH-12073: Freeing of non-ZMM pointer of incompletely allocated closure
--SKIPIF--
<?php
if (PHP_OS_FAMILY === 'Windows' && version_compare(PHP_VERSION, '8.4', '<')) {
die("xfail fails on Windows Server 2022 and newer.");
}
if (getenv("USE_ZEND_ALLOC") === "0" && getenv("USE_TRACKED_ALLOC") !== "1") {
die("skip Zend MM disabled");
}
?>
--FILE--
<?php
function test() {
$k = 1;
return function () use ($k) {
foo();
};
}
ini_set('memory_limit', '2M');
$array = [];
for ($i = 0; $i < 10_000; $i++) {
$array[] = test();
}
?>
--EXPECTF--
Fatal error: Allowed memory size of %d bytes exhausted%s(tried to allocate %d bytes) in %s on line %d