xref: /PHP-8.3/ext/intl/tests/bug62915-2.phpt (revision 74859783)
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--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?>
32--EXPECT--
33string(1) "A"
34string(1) "B"
35string(1) "C"
36string(1) "D"
37