3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php // Soubor musí být uložen v UTF-8 // Collator $collator = new Collator('cs_CZ'); $arr = array('Novák', 'Novakov', 'Žilina', 'Ábel', 'Atakdále'); $collator->sort($arr); var_dump($arr); echo "\n"; // IntlDateFormatter $formatter = new IntlDateFormatter( 'cs_CZ', IntlDateFormatter::FULL, IntlDateFormatter::MEDIUM ); echo 'Teď je ' . $formatter->format(time()) . "\n"; echo "\n"; $formatter = new IntlDateFormatter( 'cs_CZ', IntlDateFormatter::FULL, IntlDateFormatter::MEDIUM ); echo 'Za měsíc a týden bude ' . $formatter->format(strtotime('+1 month +1 week')) . "\n"; echo "\n"; // NumberFormatter $formatter = new NumberFormatter('cs_CZ', NumberFormatter::CURRENCY); echo 'Mám ' . $formatter->format(1234567.89123) . "\n"; echo "\n"; $formatter = new NumberFormatter('tn_TN', NumberFormatter::CURRENCY); echo 'Mám ' . $formatter->format(1234567.89123) . "\n"; echo "\n";
Output for 5.4.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
array(5) { [0]=> string(5) "Ábel" [1]=> string(9) "Atakdále" [2]=> string(6) "Novák" [3]=> string(7) "Novakov" [4]=> string(7) "Žilina" } Teď je úterý 16. září 2014 17:47:50 Za měsíc a týden bude čtvrtek 23. října 2014 17:47:50 Mám 1 234 567,89 Kč Mám TND 1234567.891
Output for 5.0.0 - 5.3.29
Fatal error: Class 'Collator' not found in /in/MIK91 on line 5
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected ',', expecting '(' in /in/MIK91 on line 14
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected ',', expecting '(' in /in/MIK91 on line 14
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `'('' in /in/MIK91 on line 14
Process exited with code 255.