3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $urlKey = 'ftrcvgbhnjk-2000-4628-20.html?hdfjdslkf=sdjfh'; if ($result = preg_match('/-\d+-(\d+)\.html.*$/', $urlKey, $matches)) { $result = $matches[1]; } echo $result; var_dump($matches); echo $oldUrlKey;
Output for 5.0.4 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
20array(2) { [0]=> string(29) "-4628-20.html?hdfjdslkf=sdjfh" [1]=> string(2) "20" } Notice: Undefined variable: oldUrlKey in /in/TnJ4g on line 12
Output for 4.3.0 - 5.0.3
20array(2) { [0]=> string(29) "-4628-20.html?hdfjdslkf=sdjfh" [1]=> string(2) "20" } Notice: Undefined variable: oldUrlKey in /in/TnJ4g on line 12