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

686 points
Submitted by
over 4 years ago

7/10 Putting It All Together, Part I - $numLegs question

why does it not like a space between $numLegs = 4; ? I got an error with my code until I changed it to $numLegs= 4; Does the PHP language not like the space?

Full working code:

      class Dog {
          public $numLegs= 4;
          public $name;
          public function __construct($name){
              $this->name = $name;

0 votes


php actually i dont think minds i think here they just assumed your = was part of the var

605 points
Submitted by
over 4 years ago