<?php
$f1 = msgfmt_create('en_US', '{this was made intentionally incorrect}');
echo 'f1 is ', gettype($f1), PHP_EOL;
$f2 = MessageFormatter::create('en_US', '{this was made intentionally incorrect}');
echo 'f2 is ', gettype($f2), PHP_EOL;
$f3 = new MessageFormatter('en_US', '{this was made intentionally incorrect}');
echo 'f3 is ', gettype($f3), PHP_EOL;
?>
f1 is NULL
f2 is NULL
Fatal error: Uncaught IntlException: pattern syntax error (parse error at offset 1, after "{", before or at "this was made i"): U_PATTERN_SYNTAX_ERROR in /in/3erK9:9
Stack trace:
#0 /in/3erK9(9): MessageFormatter->__construct('en_US', '{this was made ...')
#1 {main}
thrown in /in/3erK9 on line 9
Process exited with code 255.
Output for 7.3.32 - 7.3.33, 7.4.33, 8.0.13
Fatal error: Uncaught Error: Call to undefined function msgfmt_create() in /in/3erK9:3
Stack trace:
#0 {main}
thrown in /in/3erK9 on line 3
Process exited with code 255.
f1 is NULL
f2 is NULL
Fatal error: Uncaught IntlException: Constructor failed in /in/3erK9:9
Stack trace:
#0 /in/3erK9(9): MessageFormatter->__construct('en_US', '{this was made ...')
#1 {main}
thrown in /in/3erK9 on line 9
Process exited with code 255.