mirror of
https://github.com/php/php-src.git
synced 2026-03-30 20:22:36 +02:00
32 lines
832 B
PHP
32 lines
832 B
PHP
--TEST--
|
|
Bug #45392 (ob_start()/ob_end_clean() and memory_limit)
|
|
--SKIPIF--
|
|
<?php
|
|
if (getenv("USE_ZEND_ALLOC") === "0") {
|
|
die("skip Zend MM disabled");
|
|
}
|
|
$tracing = extension_loaded("Zend OPcache")
|
|
&& ($conf = opcache_get_configuration()["directives"])
|
|
&& array_key_exists("opcache.jit", $conf)
|
|
&& $conf["opcache.jit"] === "tracing";
|
|
if (PHP_OS_FAMILY === "Windows" && PHP_INT_SIZE == 8 && $tracing) {
|
|
$url = "https://github.com/php/php-src/pull/14919#issuecomment-2259003979";
|
|
die("xfail Test fails on Windows x64 (VS17) and tracing JIT; see $url");
|
|
}
|
|
?>
|
|
--FILE--
|
|
<?php
|
|
echo __LINE__ . "\n";
|
|
ini_set('memory_limit', "2M");
|
|
ob_start();
|
|
$i = 0;
|
|
while($i++ < 5000) {
|
|
echo str_repeat("may not be displayed ", 42);
|
|
}
|
|
ob_end_clean();
|
|
?>
|
|
--EXPECTF--
|
|
2
|
|
|
|
Fatal error: Allowed memory size of %d bytes exhausted%s
|