3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $urlKey = 'ftrcvgbhnjk-2000-4628-20.html'; /** * Needed for backward compatibility reasons, ensure correct resolving of old product urls * Removes the category part of the url villa-3565-67.html => villa-3565.html and indexed the old url */ $oldUrlKey = null; if (preg_match('/^.*-[0-9]+(-[0-9]+)\.html$/', $urlKey, $matches)) { $oldUrlKey = substr_replace($urlKey, '', strrpos($urlKey, $matches[1]), strlen($matches[1])); $index[$oldUrlKey] = ''; } var_dump(oldUrlKey, $matches);
Output for 4.3.0 - 5.6.28, hhvm-3.12.0, 7.0.0 - 7.1.0
Notice: Use of undefined constant oldUrlKey - assumed 'oldUrlKey' in /in/VPETR on line 15 string(9) "oldUrlKey" array(2) { [0]=> string(29) "ftrcvgbhnjk-2000-4628-20.html" [1]=> string(3) "-20" }
Output for hhvm-3.10.0

Process exited with code 153.