3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $emailed = array('cam.hurd@gmail.com', 'jeremy@derp.com', 'boooooooooop', 'dlfjdflkj', 'cam.hurd@gmail.com', 'jeremy@derp.com', 'boooooooooop', 'dlfjdflkj','cam.hurd@gmail.com', 'jeremy@derp.com', 'boooooooooop', 'dlfjdflkj'); $message = count($emailed) > 10 ? implode(array_slice($emailed, 0, 10), ', ') : (count($emailed) > 2) ? 'Invites sent to: ' . implode($emailed, ', ') . '.' : (count($emailed) == 2) ? implode($emailed, ' and ') . ' were invited' : $emailed[0] . ' was invited'; echo $message;
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
cam.hurd@gmail.com and jeremy@derp.com and boooooooooop and dlfjdflkj and cam.hurd@gmail.com and jeremy@derp.com and boooooooooop and dlfjdflkj and cam.hurd@gmail.com and jeremy@derp.com and boooooooooop and dlfjdflkj were invited