xref: /PHP-7.1/ext/intl/tests/bug62915-2.phpt (revision 0410b4e6)
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');
7--FILE--
8<?php
9class A extends IntlDateFormatter {
10		static $ARGS = array("en_US" ,IntlDateFormatter::FULL, IntlDateFormatter::FULL,
11		    'America/Los_Angeles', IntlDateFormatter::GREGORIAN);
12}
13class B extends NumberFormatter {
14		static $ARGS = array('de_DE', NumberFormatter::DECIMAL);
15}
16class C extends MessageFormatter {
17		static $ARGS = array("en_US", "foo");
18}
19class D extends Spoofchecker {
20		static $ARGS = array();
21}
22
23foreach (range('A', 'D') as $subclass) {
24		$rc = new ReflectionClass($subclass);
25			$obj = $rc->newInstanceArgs($subclass::$ARGS);
26				$clone = clone $obj;
27					var_dump(get_class($clone));
28}
29--EXPECT--
30string(1) "A"
31string(1) "B"
32string(1) "C"
33string(1) "D"
34