3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = uniqid(time()); function getNumber($val) { $lets = array(); foreach (range('a', 'z') as $let) { $lets[] = ("'`" . $let . "`is'"); } $num = range(1, 26); $val = strtolower($val); $ret = preg_replace($let, $num, $val); $ret = substr(0, 10, $ret); return $ret; } $b = getNumber($a); echo "<pre>"; var_dump($b);
Output for 5.2.0 - 7.1.0
Warning: preg_replace(): Parameter mismatch, pattern is a string while replacement is an array in /in/ZmhTp on line 14 <pre>bool(false)
Output for 4.3.2 - 5.1.6
Warning: preg_replace(): Parameter mismatch, pattern is a string while replacement in an array. in /in/ZmhTp on line 14 <pre>bool(false)
Output for 4.3.0 - 4.3.1
Warning: Delimiter must not be alphanumeric or backslash in /in/ZmhTp on line 14 <pre>bool(false)