124697
124697

Reputation: 21901

"syntax error, unfinished class declaration"

I am getting the error the title and i dont know why. I am using eclipse. anyone know what it is?

<?php

class Movie {
    $title;
    $certificate;
    $director;
    $postedUrl;
}
?>

Upvotes: 1

Views: 139

Answers (1)

Rizier123
Rizier123

Reputation: 59701

You have to add a modifier like this (public, protected, private):

class Movie {
    public $title;
    public $certificate;
    public $director;
    public $postedUrl;
}

As a reference for PHP OOP see this site: http://php.net/manual/en/language.oop5.php

Upvotes: 2

Related Questions