PHP OOP Course


#1

I am doing the PHP OOP Course and I’m at “Putting It All Together, Part II” and even though I fail it says I succeeded and I don’t know where Im doing it wrong because it doesn’t tell me anything


#2

I would recommend you reading about PHP Sunset on Codecademy.

On resume: the course is old and buggy, I advise you to move to another learning platform in order to learn PHP.

Anyway, this is the correct code in case you want to look what’s wrong with yours:

<?php
  class Perro {
    public $cantidadDePatas = 4;
    public $nombre;
    public function __construct($nombre) {
      $this->nombre = $nombre;
    }
    public function ladrar() {
      return "¡Guau!";
    }
    public function saludo() {
      return $this->nombre;
    }
  }
  $perro1 = new Perro("Pluto");
  $perro2 = new Perro("Amigo");
  echo $perro1->ladrar();
  echo $perro2->saludo();
?>

Forget my spanish names, I completed the spanish PHP course.


#3

Thanks alot for the reply :smiley: