3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = 'Today is Monday'; if (preg_match('/(.*)day/', $str, $matches)) { echo $matches[1]; } else { echo '-'; } if (preg_match('/(.*?)day/', $str, $matches)) { echo $matches[1]; } else { echo '-'; } ?>

preferences:
57.42 ms | 402 KiB | 5 Q