3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $urlKey = 'ftrcvgbhnjk-2000-4628-20.html'; $oldUrlKey = null; if (preg_match('/^.*-[0-9]+(-[0-9]+)\.html$/', $urlKey, $matches)) { substr_replace($urlKey, '', strpos($matches[1]), strlen($matches[1])); $index[$oldUrlKey] = '----'; } var_dump($matches); echo $oldUrlKey;
Output for 5.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Warning: strpos() expects at least 2 parameters, 1 given in /in/GT1JU on line 5 array(2) { [0]=> string(29) "ftrcvgbhnjk-2000-4628-20.html" [1]=> string(3) "-20" }
Output for 5.2.3 - 5.2.17
Warning: Wrong parameter count for strpos() in /in/GT1JU on line 5 array(2) { [0]=> string(29) "ftrcvgbhnjk-2000-4628-20.html" [1]=> string(3) "-20" }
Output for 4.3.0 - 5.2.2
<br /> <b>Warning</b>: Wrong parameter count for strpos() in <b>/in/GT1JU</b> on line <b>5</b><br /> array(2) { [0]=> string(29) "ftrcvgbhnjk-2000-4628-20.html" [1]=> string(3) "-20" }