I was following this tutorial for creating a cms platform (https://www.elated.com/articles/cms-in-an-afternoon-php-mysql/#step6
). I work on a mac, so I already had apache and php. I got the server running, but got the error
Parse error: syntax error, unexpected 'class' (T_CLASS) in /Users/liviarett/Documents/projects/cms-project/classes/Article.php on line 7.
So I thought I'd try XAMPP to see if it was something I had done wrong when setting everything up, but I got the exact same error.
Any ideas? The repo is here https://github.com/liviarett/cms-platform
Article.php starts with
<?php
/**
* Class to handle articles
*/
class Article {
// Properties
/**
* @var int The article ID from the database
*/
public $id = null;
I don't think there's anything wrong with the code, since I copied and pasted it from the tutorial's instructions.