<?php
// Expect to see "fr", but get null
var_dump(Locale::lookup(["fr"], str_repeat("a", 157), false, "fr"));
var_dump(intl_get_error_code());
var_dump(intl_get_error_message());
NULL
int(1)
string(89) "Locale string too long, should be no longer than 156 characters: U_ILLEGAL_ARGUMENT_ERROR"
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
NULL
int(1)
string(89) "Locale string too long, should be no longer than 156 characters: U_ILLEGAL_ARGUMENT_ERROR"
Output for 8.0.13
Fatal error: Uncaught Error: Class "Locale" not found in /in/049Fo:4
Stack trace:
#0 {main}
thrown in /in/049Fo on line 4
Process exited with code 255.
Output for 7.3.32, 7.4.26, 7.4.33
Fatal error: Uncaught Error: Class 'Locale' not found in /in/049Fo:4
Stack trace:
#0 {main}
thrown in /in/049Fo on line 4
Process exited with code 255.