3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = uniqid(time()); function getNumber($val) { $let = range('a', 'z'); for ($i = 0; $i < count($let); $i++) { $let[$i] = ("'`" . $let[$i] . "`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.3.0 - 5.6.28, 7.0.0 - 7.1.0
Notice: A non well formed numeric value encountered in /in/E2lg1 on line 13 <pre>bool(false)
Output for 4.3.0 - 5.2.17, hhvm-3.10.0 - 3.12.0
<pre>bool(false)