diff options
Diffstat (limited to 'ext/spl/tests/bug79987.phpt')
-rw-r--r-- | ext/spl/tests/bug79987.phpt | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/ext/spl/tests/bug79987.phpt b/ext/spl/tests/bug79987.phpt new file mode 100644 index 0000000000..bda5841ee7 --- /dev/null +++ b/ext/spl/tests/bug79987.phpt @@ -0,0 +1,19 @@ +--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"; +} +--EXPECT-- +Object not initialized |