com php-src: Added test: Zend/tests/bug29368_2. phpt

From: Date: Thu, 11 Apr 2019 18:37:10 +0000
Subject: com php-src: Added test: Zend/tests/bug29368_2. phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-105672@lists.php.net to get a copy of this message
Commit: db93c26e6d77e615957d47d6284ec49763d42113 Author: Dmitry Stogov <dmitry@zend.com> Thu, 11 Apr 2019 21:37:10 +0300 Parents: 27844773d85e38625318da60b4197afe79d3d59a Branches: PHP-7.4 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=db93c26e6d77e615957d47d6284ec49763d42113 Log: Added test Changed paths: A Zend/tests/bug29368_2.phpt Diff: diff --git a/Zend/tests/bug29368_2.phpt b/Zend/tests/bug29368_2.phpt new file mode 100644 index 0000000..acecefc --- /dev/null +++ b/Zend/tests/bug29368_2.phpt @@ -0,0 +1,21 @@ +--TEST-- +Bug #29368.2 (The destructor is called when an exception is thrown from the constructor). +--FILE-- +<?php +class Bomb { + function foo() { + } + function __destruct() { + throw new Exception("bomb!"); + } +} +try { + $x = new ReflectionMethod(new Bomb(), "foo"); +} catch (Throwable $e) { + echo $e->getMessage() . "\n"; +} +echo "ok\n"; +?> +--EXPECT-- +bomb! +ok

« previous php.cvs (#105672) next »