Basic OOP

Pillars of OOP

  1. Inheritance (وراثت )
  2. Polymorphism( کثيرالاشکالی )
  3. Encapsulation (کیپسول بندی ۔۔)

Advantages of OOP

  1. Code re use ability
  2. Structured
  3. Formal way of coding
  4. Better performance (Wrong)
  5. Easy Maintaince

<?php
class myclass
{
//variables = instant variable
//functions = method
//properties = ??

function do_something()
{
echo “doing something”;
}
}
$myclass_object = new myclass();
$myclass_object->do_something();
?>