title: PHP error: unexpected '=>' (T_DOUBLE_ARROW) on line 2
body: <p>I was wondering if anyone could explain to me why I am receiving an error for this piece of PHP code? From what I have been taught, this is the correct method of writing and then reading from arrays in PHP5, but I am very confused as to why the error is occurring. I have tried to research this, but I fail to see an explanation. Thank you for your time.</p>
  
  <p>The error is in this piece of code:</p>
  
  <pre><code>&lt;?php
  $sportsEquipment = $array(
    "Sports Shoes" =&gt; "50.22",
    "Hocky Stick" =&gt; "80.00",
    "Tennis balls" =&gt; "5.66");
  echo "&lt;pre&gt;";
  foreach($sportsEquipment as $key=&gt;$val) {
     printf("%-20s%20.2f\n", $key, $val);
  }
  echo "&lt;/pre&gt;";
  ?&gt;
  </code></pre>
  
  <p>The error message is: </p>
  
  <p>Parse error: syntax error, unexpected '=>' (T_DOUBLE_ARROW) on line 2</p>