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); //var_dump($num); //var_dump($lets); //var_dump($val); //die(); $ret = preg_replace($lets, $num, $val); $ret = substr(0, 10, $ret); return $ret; } $b = getNumber($a); echo "<pre>"; var_dump($b);
Output for 5.3.0 - 5.6.24, hhvm-3.12.0, 7.0.0 - 7.1.0
Notice: A non well formed numeric value encountered in /in/QuYcI on line 20 <pre>bool(false)
Output for 4.3.0 - 5.2.17, hhvm-3.10.0
<pre>bool(false)