This code works perfectly on my development server, but when I run it on another server, it fails:
$formatter = new IntlDateFormatter('en-GB', IntlDateFormatter::LONG, IntlDateFormatter::NONE, 'Europe/London');
var_dump($formatter->format(new DateTime('2012-06-01')));
var_dump($formatter->getErrorMessage() . ' ' . $formatter->getErrorCode());
Gives me:
bool(false)
string(14) "U_ZERO_ERROR 0"
Does anyone know why? It's particularly odd that it doesn't even report an error (U_ZERO_ERROR is the default). Thanks.
Edit:
For comparison, locally I get:
string(11) "1 June 2012"
string(14) "U_ZERO_ERROR 0"
I'm seeing the same issue with other locales as well, including en-US
.