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

392 points
Submitted by
almost 4 years ago

Keep getting a loading icon in the middle of my screen, or in the preview screen

            class Dog{
                public $numLegs = 4;
                public $name;

            public function __construct($name){
                $this->name = $name;

            public function bark(){
                return "Woof";

            public function greet(){
                return "Hello! My name is " . $this->name . ". What's yours?";

            $dog1 = new Dog("Barker");
            $dog2 = new Dog("Amigo");

            echo $dog1->bark();
            echo $dog2->greet();


It'll probably be a silly question, but I can't seem to figure it out! Thanks!

0 votes


closing parenthesis of class Dog must be after public function greet(), constructor and method must be inside the class Dog

721 points
Submitted by
Dimik Jones
almost 4 years ago