3v4l.org

run code in 300+ PHP versions simultaneously
<?php $options = 2; $resultado = match ($options) { 1, 2 => 'Valor de opção 1 e 2', 3 => 'Valor de opção 3', }; echo $resultado;
Output for 8.0.0 - 8.0.26, 8.1.0 - 8.1.13, 8.2rc1 - rc3
Valor de opção 1 e 2
Output for 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
Parse error: syntax error, unexpected ',' in /in/YfBUS on line 6
Process exited with code 255.

preferences:
46.19 ms | 410 KiB | 5 Q