3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $str = '/list/page/3'; preg_match('#^/list(?:/type/(\d+))?(?:/page/(\d+))?$#', $str, $matches); var_dump($matches);
based on TX72s
Output for 4.3.0 - 7.2.0
array(3) { [0]=> string(12) "/list/page/3" [1]=> string(0) "" [2]=> string(1) "3" }