3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test(string $str): void { if (preg_match('~a|(u(x))|(v(y))~', $str, $matches) === 1) { var_dump($matches); } } test("vy");
Output for 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.25, 8.4.1 - 8.4.12
array(5) { [0]=> string(2) "vy" [1]=> string(0) "" [2]=> string(0) "" [3]=> string(2) "vy" [4]=> string(1) "y" }

preferences:
63.8 ms | 406 KiB | 5 Q