<?php
// Use the default value
var_dump(IntlChar::charName("A"));
// A named character with a valid nameChoice constant value
var_dump(IntlChar::charName("A", IntlChar::UNICODE_CHAR_NAME));
// A named character, but an invalid nameChoice constant value
var_dump(IntlChar::charName("A", 12345));
string(22) "LATIN CAPITAL LETTER A"
string(22) "LATIN CAPITAL LETTER A"
NULL
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
string(22) "LATIN CAPITAL LETTER A"
string(22) "LATIN CAPITAL LETTER A"
NULL
Output for 8.0.13
Fatal error: Uncaught Error: Class "IntlChar" not found in /in/VpdDu:4
Stack trace:
#0 {main}
thrown in /in/VpdDu on line 4
Process exited with code 255.
Output for 7.0.5, 7.3.32 - 7.3.33, 7.4.33
Fatal error: Uncaught Error: Class 'IntlChar' not found in /in/VpdDu:4
Stack trace:
#0 {main}
thrown in /in/VpdDu on line 4
Process exited with code 255.
Output for 7.0.0 - 7.0.4
string(22) "LATIN CAPITAL LETTER A"
string(22) "LATIN CAPITAL LETTER A"
bool(false)