Sudden mysterious Parse error: parse error in MyApp/web/index.php on line 12

I don’t think I did anything stupid. But I am not 100% sure.

Last night, everything works perfectly. But today, after a restart of Netbeans IDE, I kept getting the following error when launching any Yii apps that previously worked.

"Parse error: parse error in MyApp/web/index.php on line 12" on the browser.

The following is my index.php file:

<?php

// comment out the following two lines when deployed to production

defined(‘YII_DEBUG’) or define(‘YII_DEBUG’, true);

defined(‘YII_ENV’) or define(‘YII_ENV’, ‘dev’);

require(DIR . ‘/../vendor/autoload.php’);

require(DIR . ‘/../vendor/yiisoft/yii2/Yii.php’);

$config = require(DIR . ‘/../config/web.php’);

(new yii\web\Application($config))->run();

Please help!!! Thank you!

Solved the problem myself. Apache somehow changed to load the old version of php.