<?php
$regions = [
'int' => 1,
'nl' => 2,
'be' => 4,
'us' => 8,
'as' => 16,
'za' => 32,
];
for ($i = 0; ++$i < 1 << count($regions); array_walk($regions, function ($x, $region) use (&$list, $i) { var_dump($x, $i); $i & $x or return; if (isset($list[$region])) $list[$region] .= ",$i"; else $list[$region] = $i; }));
var_dump($list);
- Output for 5.4.0 - 5.4.22
- Parse error: syntax error, unexpected 'return' (T_RETURN) in /in/NkYE8 on line 12
Process exited with code 255. - Output for 5.3.0 - 5.3.27
- Parse error: syntax error, unexpected '[' in /in/NkYE8 on line 3
Process exited with code 255.
preferences:
189.09 ms | 1395 KiB | 58 Q