1
0
mirror of https://github.com/php/php-src.git synced 2026-04-28 02:33:17 +02:00
Files
archived-php-src/ext/intl/tests/bug62915-2.phpt
T
Sara Golemon b627e33a8d Bugfix 63790 - Don't try to use Spoofchecker when unavailable
ICUSpoofChecker was introduced with 4.2 and may be
unavailable in some cases.
Skip this test when its not present.
2017-05-17 17:25:23 -07:00

36 lines
933 B
PHP

--TEST--
Bug #62915: cloning of several classes is defective
--SKIPIF--
<?php
if (!extension_loaded('intl'))
die('skip intl extension not enabled');
if (!class_exists('Spoofchecker'))
die('skip intl extension does not have spoof checker');
--FILE--
<?php
class A extends IntlDateFormatter {
static $ARGS = array("en_US" ,IntlDateFormatter::FULL, IntlDateFormatter::FULL,
'America/Los_Angeles', IntlDateFormatter::GREGORIAN);
}
class B extends NumberFormatter {
static $ARGS = array('de_DE', NumberFormatter::DECIMAL);
}
class C extends MessageFormatter {
static $ARGS = array("en_US", "foo");
}
class D extends Spoofchecker {
static $ARGS = array();
}
foreach (range('A', 'D') as $subclass) {
$rc = new ReflectionClass($subclass);
$obj = $rc->newInstanceArgs($subclass::$ARGS);
$clone = clone $obj;
var_dump(get_class($clone));
}
--EXPECT--
string(1) "A"
string(1) "B"
string(1) "C"
string(1) "D"