Why do a get an error when the course itself passes?


#1

This is what my code looks like:
<?php
// This is an array using integers as the indices.
// Add 'BMW' as the last element in the array!
$car = array(2012, 'blue', 5, "BMW");

    // This is an associative array.
    // Add the make => 'BMW' key/value pair!
    $assocCar = array('year' => 2012,
               'colour' => 'blue',
               'doors' => 5);
               'make' => 'BMW';`
        
    // This code should output "BMW"...
    echo $car[3];
    echo '<br />';
        
    // ...and so should this!
    echo $assocCar['make'];
  ?>

The code passes just fine, but for some reason I get the error message "Parse error: syntax error, unexpected T_DOUBLE_ARROW on line 17" in the result panel. Is it something I'm doing, or is the program off?


#2

Hi,

'doors' => 5);
 'make' => 'BMW';

You closed the Arry to early. This ); must be after BMW and remove the second smicolon.

KR