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

Objects in PHP Forum

View Course » View Exercise

462 points
6405b0163ec50e06f167aa041f94b47e?s=140&d=retro
Submitted by
NoahGray
over 3 years ago

[9 of 10] Undefined method Cat::meow

Sorry, just can't see my error here.

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

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

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

    $cat1 = new Cat("CodeCat");
    echo $cat1->weow();
    ?>

2 votes

Best answer

permalink

Typo on the word "meow". 😅

462 points
6405b0163ec50e06f167aa041f94b47e?s=140&d=retro
Submitted by
NoahGray
over 3 years ago