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); var_dump($let);die(); $ret = preg_replace($let, $num, $val); $ret = substr(0, 10, $ret); return $ret; } $b = getNumber($a); echo "<pre>"; var_dump($b);
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
array(26) { [0]=> string(7) "'`a`is'" [1]=> string(7) "'`b`is'" [2]=> string(7) "'`c`is'" [3]=> string(7) "'`d`is'" [4]=> string(7) "'`e`is'" [5]=> string(7) "'`f`is'" [6]=> string(7) "'`g`is'" [7]=> string(7) "'`h`is'" [8]=> string(7) "'`i`is'" [9]=> string(7) "'`j`is'" [10]=> string(7) "'`k`is'" [11]=> string(7) "'`l`is'" [12]=> string(7) "'`m`is'" [13]=> string(7) "'`n`is'" [14]=> string(7) "'`o`is'" [15]=> string(7) "'`p`is'" [16]=> string(7) "'`q`is'" [17]=> string(7) "'`r`is'" [18]=> string(7) "'`s`is'" [19]=> string(7) "'`t`is'" [20]=> string(7) "'`u`is'" [21]=> string(7) "'`v`is'" [22]=> string(7) "'`w`is'" [23]=> string(7) "'`x`is'" [24]=> string(7) "'`y`is'" [25]=> string(7) "'`z`is'" }