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

Objects in PHP Forum

View Course » View Exercise

1014 points
559b427ad3292fd462000498_378193755
Submitted by
Kevin O'Sullivan
over 1 year ago

Oops! Did You Add An $isAlive Property?

Hey Everyone,

I know this track can be a little buggy since it's server based?* (i think that's why at least);

I just wanted to see if I was actually missing anything here. My code, which I believe is built out correctly, is failing to pass. If anyone could point something out that I may be missing, I would be greatly appreciative.

Thanks for the help #Learn

  • My Code:

<?php
class Cat {
public $isAlive = true;
public $numLegs = 4;
public $name;

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

         public function meow() {
             return "Meow meow";
         }

         $cat1 = new Cat("CodeCat");

         echo $cat1->meow();


    ?>