3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $urlKey = 'dfbhkjdsfhsdkfkj-7348238-djfhnsdk--786.html'; $oldUrlKey = null; if (preg_match('/^.*-[0-9]+(-[0-9]+)\.html$/', $urlKey, $matches)) { $oldUrlKey = str_replace($matches[1], '', $urlKey); } echo $urlKey; echo PHP_EOL .$oldUrlKey;
Output for 4.3.10 - 4.4.9, 5.0.2 - 5.6.28, hhvm-3.12.0, 7.0.0 - 7.1.0
dfbhkjdsfhsdkfkj-7348238-djfhnsdk--786.html
Output for hhvm-3.10.0

Process exited with code 153.
Output for 4.3.1 - 4.3.9, 5.0.0 - 5.0.1
dfbhkjdsfhsdkfkj-7348238-djfhnsdk--786.html Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/TRk5T on line 8 PHP_EOL
Output for 4.3.0
dfbhkjdsfhsdkfkj-7348238-djfhnsdk--786.html Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/hHbSe on line 8 PHP_EOL