reference/intl/dateformatter/create.xml
b2332afcd09ceceed83d1e82ad94d7734012bd6f
...
...
@@ -217,6 +217,26 @@ echo "Second Formatted output with pattern is ".$fmt->format(0);
217
217
]]>
218
218
</programlisting>
219
219
</example>
220
+
<example>
221
+
<title>Example of invalid locale handling</title>
222
+
<programlisting role="php">
223
+
<![CDATA[
224
+
<?php
225
+
try {
226
+
$fmt = new IntlDateFormatter(
227
+
'invalid_locale',
228
+
IntlDateFormatter::FULL,
229
+
IntlDateFormatter::FULL,
230
+
'dunno',
231
+
IntlDateFormatter::GREGORIAN,
232
+
);
233
+
} catch (\Error $e) {
234
+
// ...
235
+
}
236
+
?>
237
+
]]>
238
+
</programlisting>
239
+
</example>
220
240
&example.outputs;
221
241
<screen>
222
242
<![CDATA[
223
243