mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
see https://wiki.php.net/rfc/error_backtraces_v2 Co-authored-by: Niels Dossche <7771979+nielsdos@users.noreply.github.com>
26 lines
691 B
PHP
26 lines
691 B
PHP
--TEST--
|
|
Test OOM on new of each class
|
|
--SKIPIF--
|
|
<?php
|
|
if (getenv("USE_ZEND_ALLOC") === "0") die("skip requires zmm");
|
|
if (getenv("SKIP_SLOW_TESTS")) die('skip slow test');
|
|
?>
|
|
--FILE--
|
|
<?php
|
|
|
|
$file = __DIR__ . '/new_oom.inc';
|
|
$php = PHP_BINARY;
|
|
|
|
foreach (get_declared_classes() as $class) {
|
|
$output = shell_exec("$php --no-php-ini $file $class 2>&1");
|
|
if ($output && preg_match('(^\nFatal error: Allowed memory size of [0-9]+ bytes exhausted[^\r\n]* \(tried to allocate [0-9]+ bytes\) in [^\r\n]+ on line [0-9]+\nStack trace:\n(#[0-9]+ [^\r\n]+\n)+$)', $output) !== 1) {
|
|
echo "Class $class failed\n";
|
|
echo $output, "\n";
|
|
}
|
|
}
|
|
|
|
?>
|
|
===DONE===
|
|
--EXPECT--
|
|
===DONE===
|