3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $promocoesDinamicas = [ 1618 => 'BlackFridayDinamica/18: MilkShake P SP', 1619 => 'BlackFridayDinamica/18: 2 MilkShake M SP', 1620 => 'BlackFridayDinamica/18: Big Bob M SP', 1621 => 'BlackFridayDinamica/18: Cheddar M SP', 1622 => 'BlackFridayDinamica/18: Trio Cheddar M SP', 1623 => 'BlackFridayDinamica/18: Bob\'s Twister SP', 1624 => 'BlackFridayDinamica/18: Trio Big Bob Picanha P SP', ]; $keys = array_keys($promocoesDinamicas); $mod = (9 % count($keys))+1; $id = (int)350417 % $mod; var_dump($keys, $mod, $id);
Output for 7.3.0rc3
array(7) { [0]=> int(1618) [1]=> int(1619) [2]=> int(1620) [3]=> int(1621) [4]=> int(1622) [5]=> int(1623) [6]=> int(1624) } int(3) int(2)