3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $string = "http://127.0.0.1:3333/item/id/3"; $path = parse_url($string, PHP_URL_PATH); $pattern = '[^\/]+$'; preg_match($pattern, $path, $matches); echo $matches[1]; //echo $path;
based on EER8V
Output for 5.6.0 - 5.6.30, 7.0.0 - 7.3.0rc3
Warning: preg_match(): Unknown modifier '+' in /in/JAIlc on line 8
Output for hhvm-3.15.4
Warning: Unknown modifier '+': [[^\/]+$] in /in/JAIlc on line 8