3v4l.org

run code in 300+ PHP versions simultaneously
<?php $fmtEN = new MessageFormatter("en_US", "{GENDER, select, male {He} female {She} other {} } 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} other {} } {NUM_ITEMS, plural, one {1 kotka} few {# kotki} 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; echo $fmtEN->format(['GENDER' => 'female', 'NUM_ITEMS'=> 3]); echo PHP_EOL; echo $fmtPL->format(['GENDER' => 'female', 'NUM_ITEMS'=> 3]); echo PHP_EOL; $fmtEN = new MessageFormatter("en_US", "You added {NUM_ITEMS, plural, one {1 kitten} other {# kittens} } to the cart."); $fmtPL = new MessageFormatter("pl_PL", "{GENDER, select, male {Dodales} female {Dodalas} other {} } {NUM_ITEMS, plural, one {1 kotka} few {# kotki} 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; echo $fmtEN->format(['GENDER' => 'female', 'NUM_ITEMS'=> 3]); echo PHP_EOL; echo $fmtPL->format(['GENDER' => 'female', 'NUM_ITEMS'=> 3]); echo PHP_EOL;
Output for git.master, git.master_jit, rfc.property-hooks
He added 5 kittens to the cart. On dodal 5 kotkow do koszyka. She added 3 kittens to the cart. Ona dodala 3 kotki do koszyka. You added 5 kittens to the cart. Dodales 5 kotkow do koszyka. You added 3 kittens to the cart. Dodalas 3 kotki do koszyka.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
41.68 ms | 402 KiB | 8 Q