3v4l.org

run code in 300+ PHP versions simultaneously
<?php $path = 'Nil'; $index = 'surveyandmedia3'; $medianame = preg_match("/surveyandmedia(\d+)$/",$index,$qnumber); if(count($qnumber) > 0) $path = $qnumber; else $path = $index; print_r($path[1]); ?>

preferences:
42.78 ms | 402 KiB | 5 Q