What is it called when I create an object in PHP and declare variables inside this object?

advertisements

I know this is not great practice, but I need a definition in order to get my real question answered.

I have an object like this:

class Car
{
   public $wheel;
   public $engine;
   so on..
}

I instantiate and edit values like thus:

myCar = new Car();
myCar->wheels = 4;
myCar->engine = V8;

What is it called when I do this?:

myCar->brakes = "disc";

It populates the new key and value in the existing object, but I don't know the name for that.

Update: I removed the parentheses. :)


Simply put, you are creating and assigning a new instance variable inside of the myCar object.