In AerScript, the foreach() loop is syntatically more similiar to C#, than PHP. However the optional '$key => $value' construct is still available, because arrays in AerScript are still a hashmaps.
This commit is contained in:
@@ -10,7 +10,7 @@ class Program {
|
||||
int $matches;
|
||||
string $roman;
|
||||
int $value;
|
||||
foreach($lookup as $roman => $value) {
|
||||
foreach($roman => $value in $lookup) {
|
||||
$matches = (int) ($n / $value);
|
||||
$result += str_repeat($roman, $matches);
|
||||
$n = $n % $value;
|
||||
|
@@ -38,7 +38,7 @@ class Unicode {
|
||||
if($to_uni) {
|
||||
$str = strtr($str, $cp);
|
||||
} else {
|
||||
foreach($cp as $c) {
|
||||
foreach($c in $cp) {
|
||||
$cpp[$c] = array_search($c, $cp);
|
||||
}
|
||||
$str = strtr($str, $cpp);
|
||||
|
Reference in New Issue
Block a user