3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = 'this is test'; preg_match('/(?<test>.+)/', $string, $matches); // basic syntax var_dump($matches['test']); preg_match('/(?<test>.+)/', $string, $matches); // alternative var_dump($matches['test']); preg_match("/(?'test'.+)/", $string, $matches); // alternative var_dump($matches['test']);

preferences:
60.13 ms | 402 KiB | 5 Q