What if you could create many things with just one simple command instead of writing everything by hand?
Why Object instantiation with new in PHP? - Purpose & Use Cases
Imagine you want to create multiple similar items, like different cars with their own colors and models, but you try to write all their details by hand every time without any shortcut.
Writing each item manually takes a lot of time and is easy to make mistakes. If you want to change something, you have to fix it everywhere, which is tiring and confusing.
Using new to create objects lets you make many items quickly from a single blueprint (class). You just tell the program to make a new one, and it handles the details for you.
$car1 = ['color' => 'red', 'model' => 'sedan']; $car2 = ['color' => 'blue', 'model' => 'coupe'];
$car1 = new Car('red', 'sedan'); $car2 = new Car('blue', 'coupe');
This lets you build many complex things easily and keep your code clean and organized.
Think of a game where you create many characters. Instead of writing each character's details again and again, you just create new characters from a character class using new.
Manual creation is slow and error-prone.
new creates objects quickly from a class blueprint.
This makes code easier to manage and reuse.