3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $ordinalFormatter = new NumberFormatter('en', NumberFormatter::ORDINAL); $numbers = range(1, 30); $ordinals = []; array_walk($numbers, function ($number) use ($ordinalFormatter, $ordinals) { $ordinals[] = $ordinalFormatter->format($number); }); printf("Ordinals: %s\n", implode(', ', $ordinals));
based on pkXNn
Output for 5.6.0 - 5.6.30, hhvm-3.18.5 - 3.22.0, 7.0.0 - 7.2.11, 7.3.0rc3
Ordinals:
Output for 7.3.0alpha1 - 7.3.0beta1
Fatal error: Uncaught Error: Class 'NumberFormatter' not found in /in/cf9JE:3 Stack trace: #0 {main} thrown in /in/cf9JE on line 3
Process exited with code 255.