0

My code runs perfectly on localhost.. But when I sent it to web, I get this error:

PHP Parse error: parse error in E:\home\site\Web\sw\class\sql.php on line 60

Here is the line 60:

        if($caractere) {


            $code = preg_replace_callback(
               "/(SW_(\w+))/",
               function($matches) use ($line) { //THIS IS THE LINE 60

                    return utf8_encode($line[$matches[2]]);
               },
               $codigoHtmlDeRetorno
            );
            echo $codigo;

        }

I really can't understand! Where is the fault?

Flávio Alencar
  • 192
  • 1
  • 2
  • 9
  • Your sever runs on PHP <5.3, means it doesn't support anonymous functions. Your server either runs with 4.2.2/3/4 and PHP 4 is already dead forever. (Do: `echo PHP_VERSION;` to see the version) – Rizier123 Mar 09 '16 at 02:04
  • 1
    BTW: PHP 4.3.3 is from 2002, which is over 14 years ago, you definitely need to upgrade your server. – Rizier123 Mar 09 '16 at 02:09

0 Answers0