3v4l.org

run code in 300+ PHP versions simultaneously
<?php function outputOptions(array $options){ if ($options[0] == 'email') { echo "You can send the selected records to your email."; } else { echo "You can download the selected records in $options[0]"; $last = count($options) - 1; if($last == 0) echo '.'; else { for($i = 1; $i < $last; $i++) echo ", $options[$i]"; echo $options[$last] == 'email' ? ', or send them to your email.' : ", or $options[$last]."; } } echo "\n"; } outputOptions(['Word']); outputOptions(['Word', 'Excel']); outputOptions(['Word', 'PDF']); outputOptions(['Word', 'Excel', 'PDF']); outputOptions(['email']); outputOptions(['Word', 'email']); outputOptions(['Word', 'Excel', 'email']); outputOptions(['Word', 'PDF', 'email']); outputOptions(['Word', 'Excel', 'PDF', 'email']);
Output for 8.0.1 - 8.0.30, 8.1.0 - 8.1.34, 8.2.0 - 8.2.30, 8.3.0 - 8.3.29, 8.4.1 - 8.4.14, 8.4.16 - 8.4.17, 8.5.0 - 8.5.2
You can download the selected records in Word. You can download the selected records in Word, or Excel. You can download the selected records in Word, or PDF. You can download the selected records in Word, Excel, or PDF. You can send the selected records to your email. You can download the selected records in Word, or send them to your email. You can download the selected records in Word, Excel, or send them to your email. You can download the selected records in Word, PDF, or send them to your email. You can download the selected records in Word, Excel, PDF, or send them to your email.
Output for 8.4.15
/bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.35' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.34' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15)
Process exited with code 1.

preferences:
119.96 ms | 408 KiB | 5 Q