3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $fmtEN = new MessageFormatter("en_US", "{GENDER, select, male {He} female {She} } added {NUM_ITEMS, plural, one {1 kitten} other {# kittens} } to the cart."); $fmtPL = new MessageFormatter("pl_PL", "{GENDER, select, male {On dodal} female {Ona dodala} } {NUM_ITEMS, plural, one {1 kotka} other {# kotkow} } do koszyka."); echo $fmtEN->format(['GENDER' => 'male', 'NUM_ITEMS'=> 5]); echo PHP_EOL; echo $fmtPL->format(['GENDER' => 'male', 'NUM_ITEMS'=> 5]); echo PHP_EOL;
Output for 7.0.20, 7.1.5 - 7.2.0
Fatal error: Uncaught IntlException: Constructor failed in /in/iioVt:3 Stack trace: #0 /in/iioVt(3): MessageFormatter->__construct('en_US', '{GENDER, select...') #1 {main} thrown in /in/iioVt on line 3
Process exited with code 255.
Output for 7.0.0 - 7.0.11, 7.1.0
Fatal error: Uncaught IntlException: Constructor failed in /in/iioVt:9 Stack trace: #0 /in/iioVt(9): MessageFormatter->__construct('en_US', '{GENDER, select...') #1 {main} thrown in /in/iioVt on line 9
Process exited with code 255.
Output for 5.6.0 - 5.6.28
Fatal error: Call to a member function format() on null in /in/iioVt on line 18
Process exited with code 255.
Output for 5.4.0 - 5.5.38
Fatal error: Call to a member function format() on a non-object in /in/iioVt on line 18
Process exited with code 255.