3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = true; $val = match ($input) { true => [$foo = 1, $bar = 2, $foo + $bar][2], false => "nah", }; var_dump($val);

preferences:
33.69 ms | 404 KiB | 5 Q