1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00
Files
archived-php-src/ext/spl/tests/bug79987.phpt
2020-10-19 10:35:22 +02:00

39 lines
830 B
PHP

--TEST--
Bug #79987 (Memory leak in SplFileInfo because of missing zend_restore_error_handling())
--FILE--
<?php
class BadSplFileInfo extends SplFileInfo {
public function __construct() {
}
}
$x = new BadSplFileInfo();
set_error_handler(function ($type, $msg, $file, $line, $context = []) {
echo "ops\n";
});
try {
var_dump($x->getLinkTarget());
} catch (Throwable $e) {
echo $e->getMessage() . "\n";
}
try {
var_dump($x->getFilename());
} catch (Throwable $e) {
echo $e->getMessage() . "\n";
}
try {
var_dump($x->getExtension());
} catch (Throwable $e) {
echo $e->getMessage() . "\n";
}
try {
var_dump($x->getBasename());
} catch (Throwable $e) {
echo $e->getMessage() . "\n";
}
?>
--EXPECT--
Object not initialized
Object not initialized
Object not initialized
Object not initialized