xref: /PHP-7.2/ext/intl/tests/bug62915-2.phpt (revision b627e33a)
1--TEST--
2Bug #62915: cloning of several classes is defective
3--SKIPIF--
4<?php
5if (!extension_loaded('intl'))
6	    die('skip intl extension not enabled');
7if (!class_exists('Spoofchecker'))
8		die('skip intl extension does not have spoof checker');
9--FILE--
10<?php
11class A extends IntlDateFormatter {
12		static $ARGS = array("en_US" ,IntlDateFormatter::FULL, IntlDateFormatter::FULL,
13		    'America/Los_Angeles', IntlDateFormatter::GREGORIAN);
14}
15class B extends NumberFormatter {
16		static $ARGS = array('de_DE', NumberFormatter::DECIMAL);
17}
18class C extends MessageFormatter {
19		static $ARGS = array("en_US", "foo");
20}
21class D extends Spoofchecker {
22		static $ARGS = array();
23}
24
25foreach (range('A', 'D') as $subclass) {
26		$rc = new ReflectionClass($subclass);
27			$obj = $rc->newInstanceArgs($subclass::$ARGS);
28				$clone = clone $obj;
29					var_dump(get_class($clone));
30}
31--EXPECT--
32string(1) "A"
33string(1) "B"
34string(1) "C"
35string(1) "D"
36