summaryrefslogtreecommitdiff
path: root/ext/intl/tests/dateformat_clone_bad_obj.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/intl/tests/dateformat_clone_bad_obj.phpt')
-rw-r--r--ext/intl/tests/dateformat_clone_bad_obj.phpt20
1 files changed, 20 insertions, 0 deletions
diff --git a/ext/intl/tests/dateformat_clone_bad_obj.phpt b/ext/intl/tests/dateformat_clone_bad_obj.phpt
new file mode 100644
index 0000000000..5e12b96ae8
--- /dev/null
+++ b/ext/intl/tests/dateformat_clone_bad_obj.phpt
@@ -0,0 +1,20 @@
+--TEST--
+Cloning unconstructed IntlDateFormatter
+--SKIPIF--
+<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
+--FILE--
+<?php
+
+class A extends IntlDateFormatter {
+ function __construct() {}
+}
+
+$a = new A;
+try {
+ $b = clone $a;
+} catch (Exception $e) {
+ var_dump($e->getMessage());
+}
+
+--EXPECTF--
+string(%s) "Cannot clone unconstructed IntlDateFormatter"