unexpected T_USE, expecting '{'

php, syntax

Solution

It should be:

$countWords = function($file) use($wordFrequencyArray) {
  //...
};

Problem

``` <?php $wordFrequencyArray = array(); function countWords($file) use($wordFrequencyArray) { //error here /* get content of $filename in $content */ $content = strtolower(file_get_contents($filename)); ``` Here is a snippet of a code i am using. I am getting error on the 3rd line. I have all the matching braces .What might be wrong?

Original source