This forum is now read-only. Please use our new forums! Go to forums

0 points
Submitted by Riccardo Fraioli
almost 11 years

Response ;Did you create a 'Cat' class? ---> but , it's my error .. but idont see...

    <?php
      // Your code here
      Class Cat{
          public $isAlive=true;
          public $numLegs=4;
          public $name;
      public function __construct($name){
        $this->name=$name  ;
      
      
      }
      public function meow(){
          return "Meow meow";}
      
      }
      $nam= new Cat("CodeCat");
      echo $nam->meow();

// Response ;Oops, try again! Did you create a ‘Cat’ class? —> ?>

Answer 5252d6d080ff33a453000186

4 votes

Permalink

all you need to do is take the capital C in class and change it to a lowercase c. It worked perfectly.

points
Submitted by haleycoe
over 10 years

Answer 51c35b8b631fe9f7ee002df2

1 vote

Permalink

Try adding

   $cat1 = new Cat("CodeCat");
            echo $cat1->meow();
points
Submitted by Brian Machado
almost 11 years

Answer 51b8cde6282ae3a0fb0002c3

0 votes

Permalink

      $CodeCat = new Cat;
      echo $CodeCat->meow();
points
Submitted by romanornr
almost 11 years

Answer 51d47c3f631fe981f900227b

0 votes

Permalink

Did you close the Cat class? Class cat { …. }

points
Submitted by kailashf
over 10 years

Answer 52004f3980ff331be5000d9b

0 votes

Permalink

try this…

      class Cat{
          public $isAlive = true;
          public $numLegs = 4;
          public $name;
          public function __construct($name){
              $this->name= $name;
          }
      
      public function Meow() {
          return "Meow meow";}
      }
      $cat = new cat ("CodeCat");
     
      echo $cat->Meow();
points
Submitted by Arubi Amos Adimah
over 10 years

Answer 531dfd198c1ccccff0000c98

0 votes

Permalink

Sorry, no offence, but you all are wrong. I just figured out the problem. <?php Class Cat{ public $isAlive=true; public $numLegs=4; public $name; public function __construct($name){ $this->name=$name ;

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

  }
  $name= new Cat("CodeCat");
  echo $name->meow();

    ?>
You put nam instead of name. Hope this was helpful and continue learning.
points
Submitted by roronoazoro16
about 10 years

Answer 536cff6c548c3542840001b5

0 votes

Permalink

class is spelled with a lowercase “c” and you also have name spelled wrong

points
almost 10 years

Answer 519f95216653d64768000053

-6 votes

Permalink

I am sorryyyyyyyyyyyyyyyyyy $cat1 i don tsee the name is $cat1 on exmaple ……….

points
Submitted by Riccardo Fraioli
almost 11 years

1 comments

Riccardo Fraioli almost 11 years

And the Class -.————- reverse to ————— class