How And Why Can We Start A Project Without OOP in PHP?

PHP is not fundamentally an object oriented language like JAVA. It means we as developers can choose to not implement classes and objects. We can simple write code in linear fashion or make functions in one public scope. As simple as bread and butter.

Classes and Objects may add a lot of complications so if you are working on a very small project just be very straight forward and save your time. Write code in linear format in one public scope without any classes. An example shown in the code below.

For example, where you will submit form using Post method for a product write this code.

function addProductInDatabase( $nameOfProduct, $priceOfProduct, $descOfProduct ) {
	//save product in database
}

Where you will save submit form to find product by name you can write just this code.

function addProductInDatabase( $nameOfProduct, $priceOfProduct, $descOfProduct ) {
	//save product in database
}

and where you are updating price for your product you can write this code.

$nameOfProduct  = $_POST['name'];
$priceOfProduct = $_POST['price'];
function changeProductPrice( $priceOfProduct ) {
	//update price
}

The point is it is absolutely fine to use no classes what so ever. PHP allows it and it is great to start a project or submit a quick assignment easily.

However after certain period of time if project is going great things will be complex. For example my personal theory is when code in more than 1000 lines.

You can have your own mechanism but this one worked fine for me. After that you will find very difficult to work on this project. So you can use classes and object. PHP is not OOP based language by nature yet it is very effective so use that for your benefit.

The class stdClass is already used by PHP internally so you can not declare this class in your own code.