Classes and Objects
class Student { public $name; function __construct($name) { $this->name = $name; } } $s = new Student('Asha'); Object is one student. Class is the blueprint. $this is that object.
public/private/protected control who can touch fields. Keep fields private when you can.
Trap — $s.method() like JS. PHP is $s->method(). Trap: forgetting new.
Exam tip
new Student('Asha'); $s->name $this inside the class.