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