Code that works on my localhost (PHP 5.3.4) is not working on older PHP environment on live server (PHP 5.2.17)
<p>This is my code that is working nice on my localhost:</p>

<pre><code>&lt;?php
$list = array();
array_map(function($var){}, $matches_array_1);
foreach ( $matches_array_1 as $value ) {
    $key = $value['team'];

    if (array_key_exists($key, $list)) {
        $list[$key]['team_points'] += $value['team_points'];
        $list[$key]['team_occurrences'] ++;
    } else {
        $list[$key] = $value;
        $list[$key]['team_occurrences'] = 1;
    }
}
usort($list ,function($a, $b){ $a = $a['team_points'] ; $b = $b['team_points'] ; return ($a == $b) ? 0 : (($a &lt; $b) ? 1 : -1 ) ;});

?&gt;
</code></pre>

<p>But on the server it throws an error:</p>

<p><strong>Parse error: syntax error, unexpected T_FUNCTION, expecting ')'</strong> </p>

<p>for this line:</p>

<pre><code>array_map(function($var){}, $matches_array_1);
</code></pre>

<p><strong>My localhost WAMP PHP version is 5.4.3</strong> </p>

<p><strong>My server PHP version is 5.2.17</strong></p>

<p>I would like to change th code so it works on both environments.</p>

<p>Thanks for any advice.</p>
