reference/intl/dateformatter/get-calendar.xml
b2332afcd09ceceed83d1e82ad94d7734012bd6f
...
...
@@ -95,6 +95,27 @@ echo 'Now calendar of the formatter is : ' . $fmt->getCalendar();
95
95
]]>
96
96
</programlisting>
97
97
</example>
98
+
<example>
99
+
<title>Example of invalid locale handling</title>
100
+
<programlisting role="php">
101
+
<![CDATA[
102
+
<?php
103
+
try {
104
+
$fmt = new IntlDateFormatter(
105
+
'invalid_locale',
106
+
IntlDateFormatter::FULL,
107
+
IntlDateFormatter::FULL,
108
+
'dunno',
109
+
IntlDateFormatter::GREGORIAN,
110
+
);
111
+
$cal = $fmt->getCalendar();
112
+
} catch (\Error $e) {
113
+
// ...
114
+
}
115
+
?>
116
+
]]>
117
+
</programlisting>
118
+
</example>
98
119
&example.outputs;
99
120
<screen>
100
121
<![CDATA[
101
122