1--TEST-- 2IntlDatePatternGenerator::getBestPattern() 3--EXTENSIONS-- 4intl 5--SKIPIF-- 6<?php if (version_compare(INTL_ICU_VERSION, '72.1') >= 0) die('skip for ICU < 72.1'); ?> 7--FILE-- 8<?php 9 10ini_set("intl.error_level", E_WARNING); 11ini_set("intl.default_locale", "en_US"); 12 13$dtpg = new IntlDatePatternGenerator(); 14$dtpg2 = new IntlDatePatternGenerator("de_DE"); 15$dtpg3 = IntlDatePatternGenerator::create(); 16$dtpg4 = IntlDatePatternGenerator::create("de_DE"); 17 18echo $dtpg->getBestPattern("jjmm"), "\n"; 19echo $dtpg2->getBestPattern("jjmm"), "\n"; 20echo $dtpg3->getBestPattern("YYYYMMMdd"), "\n"; 21echo $dtpg4->getBestPattern("YYYYMMMdd"), "\n"; 22 23echo $dtpg->getBestPattern(""), "\n"; 24 25try { 26 $dtpg->getBestPattern(); 27} catch(\ArgumentCountError $e) { 28 echo $e->getMessage(), "\n"; 29} 30 31?> 32--EXPECT-- 33h:mm a 34HH:mm 35MMM dd, YYYY 36dd. MMM YYYY 37 38IntlDatePatternGenerator::getBestPattern() expects exactly 1 argument, 0 given 39