This forum is now read-only. Please use our new forums at

Objects in PHP Forum

View Course » View Exercise

1175 points
Submitted by
almost 2 years ago

Why does my correct code get a strange error message?

This is what my code looks like:
class Dog {
public $numLegs = 4;
public $name();
public function __construct($name) {
$this->name = $name;

It passes just fine, it looks like the given hints, but for some reason, I get a strange error message in the panel box.
This is the message:
"Parse error: syntax error, unexpected '(', expecting ',' or ';' on line 12".

Can something explain if I'm doing something wrong, or if it is just the code itself?