1 | <?php |
||
13 | class LanguageExtension extends \Twig_Extension |
||
14 | { |
||
15 | public function __construct() |
||
21 | |||
22 | public function getFilters() |
||
31 | |||
32 | /** |
||
33 | * Return the country name using the Locale class. |
||
34 | * |
||
35 | * @param string $isoCode Country ISO 3166-1 alpha 2 code |
||
36 | * @param null|string $locale Locale code |
||
37 | * |
||
38 | * @return null|string Country name |
||
39 | */ |
||
40 | public function getLanguageName($isoCode, $locale = null) |
||
54 | |||
55 | public function getName() |
||
59 | } |
||
60 |
In PHP, under loose comparison (like
==
, or!=
, orswitch
conditions), values of different types might be equal.For
string
values, the empty string''
is a special case, in particular the following results might be unexpected: