SlideShare a Scribd company logo
OBJECT ORIENTED
PROGRAMMING
PAPER NAME : PROGRAMMING IN PHP
STAFF NAME : MS.V.SHANTHI M.SC,M.PHIL,M,TECH,PGDCA.
CLASS : III BCA
SEMESTER : VI
Object oriented programming
 PHP is a server side scripting language,
mainly used for web development but also
used as a general proposition
programming language. Object Oriented
Programming, is a type of
programming language principle added to php
, that helps in building complex, reusable web
applications.
OBJECT ORIENTED CONCEPTS
• Class
• Object
• Member Variable
• Member Function
• Inheritance
• Parent Class
• Child Class
• Polymorphism
• Data Abstraction
• Encapsulation
• Constructor
• Destructor
Class:
 This is a programmer defined data type which
inject local functions as well as local data. You
can think of a class as a template for making
many specimen of the same kind of object.
Object:
 An single instance of the data structure
defined by a class. You define a class once and
then make many objects that befit to it.
Objects are also known as specimen.
Member Variable:
 These are the variables defined inside a class.
This data will be insensible to the outside of
the class and can be accessed via member
functions. These variables are called virtue of
the object once an object is created.
Member function :
 These are the function clear inside a class and
are used to admission object data.
Inheritance:
 When a class is defined by inheriting current
function of a parent class then it is called
inheritance. Here child class will receive all or
few member functions and variables of a
parent class.
Parent class:
 A class that is inborn from by another class.
This is also called a base class or super class.
Child class:
 A class that receives from another class. This
is also called a subclass or derived class.
Polymorphism:
 This is an object oriented idea where same
function can be used for dissimilar purposes.
For example function name will remain same
but it take different number of clash and can
do different task.
Overloading:
 A type of polymorphism in which some or all
of operators have different implementations
build upon on the types of their arguments.
Build upon functions can also be overloaded
with different implementation.
Data Abstraction:
 Any representation of data in which the
implementation details are occult.
Encapsulation:
 Refers to a idea where we encapsulate all the
data and member functions constant to form
an object.
Constructor:
 Refers to a exceptional type of function which
will be called spontaneously whenever there is
an object formation from a class.
Destructor:
 Refers to a exceptional type of function which
will be called spontaneously whenever an
object is deleted or goes out of scope.
PHP: Inheritance
• Inheritance is a well-established programming
principle.
• Inheritance allows classes to form a hierarchy
like a family tree.
• Allows subclasses to share the techniques and
belongings (which are public or protected) of
its superclass.
• Superclass is the parent class.
• A subclass can add properties and methods.
• Inheritance allows reusing code.
PHP: Inheritance
INTERFACES:
 An interface is a explanation of the actions
that an entity can do.
 Interface is written in the similar way as
the class the statement with interface
keyword.
Rules of Interfaces:
• All methods professed in an interface must be
public; this is the nature of an interface.
• All methods in the interface must be applied
within a class; failure to do so will result in a
fatal error.
• The class applying the interface must use the
exact same technique signatures as are defined
in the interface
• Interfaces can be prolonged like classes using
the spreads operator.
Abstract Classes:
 An abstract class is a class that contains at
least one abstract technique. The abstract
technique is function declaration without
anybody and it has the only name of the
technique and its parameters.
 There can be any number of techniques in the
class and we have to announce the class as
abstract only when there is an abstract method
PHP: Interfaces
• Provides methods to implement.
• Derived classes may implement more than one
interface.
• Interfaces may succeed to from other
interfaces using the extends keyword.
• All techniques are supposed to be public in the
interface definition can be defined explicitly as
public or implicitly.
• When a class equipment multiple interfaces
there cannot be any naming collision between
methods defined in the different interfaces.
PHP: Object Cloning
• Cloning is used to produce a copy of an object.
• An entity copy is produced by using
the clone keyword.
• When an entity is cloned, PHP 5 will perform
a shallow copy of all of the object's properties.
• PHP affords a special method __clone to copy
an object.
• Once the cloning is complete, if a __clone()
method is defined, then the newly created
object's __clone() method will be called, to
allow any necessary properties that need to be
changed.

More Related Content

What's hot

General oop concepts
General oop conceptsGeneral oop concepts
General oop concepts
Avneesh Yadav
 
General oop concept
General oop conceptGeneral oop concept
General oop concept
Avneesh Yadav
 
Object oriented vs. object based programming
Object oriented vs. object based  programmingObject oriented vs. object based  programming
Object oriented vs. object based programming
Mohammad Kamrul Hasan
 
Object Oriented Programming Overview for the PeopleSoft Developer
Object Oriented Programming Overview for the PeopleSoft DeveloperObject Oriented Programming Overview for the PeopleSoft Developer
Object Oriented Programming Overview for the PeopleSoft Developer
Lee Greffin
 
OOP in Java
OOP in JavaOOP in Java
OOP in Java
wiradikusuma
 
Object oriented programming tutorial
Object oriented programming tutorialObject oriented programming tutorial
Object oriented programming tutorial
Ghulam Abbas Khan
 
Object Oriented Programming Principles
Object Oriented Programming PrinciplesObject Oriented Programming Principles
Object Oriented Programming Principles
Andrew Ferlitsch
 
Polymorphism
PolymorphismPolymorphism
Polymorphism
Nuha Noor
 
PHP - Procedural To Object-Oriented
PHP - Procedural To Object-OrientedPHP - Procedural To Object-Oriented
PHP - Procedural To Object-Oriented
Vance Lucas
 
Practical OOP In Java
Practical OOP In JavaPractical OOP In Java
Practical OOP In Java
wiradikusuma
 
Packages and interfaces
Packages and interfacesPackages and interfaces
Packages and interfaces
bhuvaneshwariA5
 
01 introduction to oop and java
01 introduction to oop and java01 introduction to oop and java
01 introduction to oop and java
রাকিন রাকিন
 
Advanced software engineering lab 2
Advanced software engineering lab 2Advanced software engineering lab 2
Advanced software engineering lab 2
asimnawaz54
 
Structure of java program diff c- cpp and java
Structure of java program  diff c- cpp and javaStructure of java program  diff c- cpp and java
Structure of java program diff c- cpp and java
Madishetty Prathibha
 
[OOP - Lec 01] Introduction to OOP
[OOP - Lec 01] Introduction to OOP[OOP - Lec 01] Introduction to OOP
[OOP - Lec 01] Introduction to OOP
Muhammad Hammad Waseem
 
Introduction to oop and java fundamentals
Introduction to oop and java fundamentalsIntroduction to oop and java fundamentals
Introduction to oop and java fundamentals
AnsgarMary
 
[OOP - Lec 06] Classes and Objects
[OOP - Lec 06] Classes and Objects[OOP - Lec 06] Classes and Objects
[OOP - Lec 06] Classes and Objects
Muhammad Hammad Waseem
 
Cs8392 oops 5 units notes
Cs8392 oops 5 units notes Cs8392 oops 5 units notes
Cs8392 oops 5 units notes
Narayanan sockalinganathan
 
Java Object Oriented Programming
Java Object Oriented Programming Java Object Oriented Programming
Java Object Oriented Programming
University of Potsdam
 

What's hot (19)

General oop concepts
General oop conceptsGeneral oop concepts
General oop concepts
 
General oop concept
General oop conceptGeneral oop concept
General oop concept
 
Object oriented vs. object based programming
Object oriented vs. object based  programmingObject oriented vs. object based  programming
Object oriented vs. object based programming
 
Object Oriented Programming Overview for the PeopleSoft Developer
Object Oriented Programming Overview for the PeopleSoft DeveloperObject Oriented Programming Overview for the PeopleSoft Developer
Object Oriented Programming Overview for the PeopleSoft Developer
 
OOP in Java
OOP in JavaOOP in Java
OOP in Java
 
Object oriented programming tutorial
Object oriented programming tutorialObject oriented programming tutorial
Object oriented programming tutorial
 
Object Oriented Programming Principles
Object Oriented Programming PrinciplesObject Oriented Programming Principles
Object Oriented Programming Principles
 
Polymorphism
PolymorphismPolymorphism
Polymorphism
 
PHP - Procedural To Object-Oriented
PHP - Procedural To Object-OrientedPHP - Procedural To Object-Oriented
PHP - Procedural To Object-Oriented
 
Practical OOP In Java
Practical OOP In JavaPractical OOP In Java
Practical OOP In Java
 
Packages and interfaces
Packages and interfacesPackages and interfaces
Packages and interfaces
 
01 introduction to oop and java
01 introduction to oop and java01 introduction to oop and java
01 introduction to oop and java
 
Advanced software engineering lab 2
Advanced software engineering lab 2Advanced software engineering lab 2
Advanced software engineering lab 2
 
Structure of java program diff c- cpp and java
Structure of java program  diff c- cpp and javaStructure of java program  diff c- cpp and java
Structure of java program diff c- cpp and java
 
[OOP - Lec 01] Introduction to OOP
[OOP - Lec 01] Introduction to OOP[OOP - Lec 01] Introduction to OOP
[OOP - Lec 01] Introduction to OOP
 
Introduction to oop and java fundamentals
Introduction to oop and java fundamentalsIntroduction to oop and java fundamentals
Introduction to oop and java fundamentals
 
[OOP - Lec 06] Classes and Objects
[OOP - Lec 06] Classes and Objects[OOP - Lec 06] Classes and Objects
[OOP - Lec 06] Classes and Objects
 
Cs8392 oops 5 units notes
Cs8392 oops 5 units notes Cs8392 oops 5 units notes
Cs8392 oops 5 units notes
 
Java Object Oriented Programming
Java Object Oriented Programming Java Object Oriented Programming
Java Object Oriented Programming
 

Similar to Oopsinphp

UNIT-IV WT web technology for 1st year cs
UNIT-IV WT web technology for 1st year csUNIT-IV WT web technology for 1st year cs
UNIT-IV WT web technology for 1st year cs
javed75
 
Object oriented programming
Object oriented programmingObject oriented programming
Php oop (1)
Php oop (1)Php oop (1)
Php oop (1)
Sudip Simkhada
 
Introduction to OOP concepts
Introduction to OOP conceptsIntroduction to OOP concepts
Introduction to OOP concepts
Ahmed Farag
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
Saiful Islam Sany
 
Lecture-10_PHP-OOP.pptx
Lecture-10_PHP-OOP.pptxLecture-10_PHP-OOP.pptx
Lecture-10_PHP-OOP.pptx
ShaownRoy1
 
Principles of OOPs.pptx
Principles of OOPs.pptxPrinciples of OOPs.pptx
Principles of OOPs.pptx
LakshyaChauhan21
 
Introduction to oop
Introduction to oopIntroduction to oop
Introduction to oop
colleges
 
OOPS – General Understanding in .NET
OOPS – General Understanding in .NETOOPS – General Understanding in .NET
OOPS – General Understanding in .NET
Sabith Byari
 
C#.net interview questions for dynamics 365 ce crm developers
C#.net interview questions for dynamics 365 ce crm developersC#.net interview questions for dynamics 365 ce crm developers
C#.net interview questions for dynamics 365 ce crm developers
Sanjaya Prakash Pradhan
 
Lecture 8
Lecture 8Lecture 8
full defination of final opp.pptx
full defination of final opp.pptxfull defination of final opp.pptx
full defination of final opp.pptx
rayanbabur
 
Oops
OopsOops
Unit 4
Unit 4Unit 4
Object-oriented programming 3.pptx
Object-oriented programming 3.pptxObject-oriented programming 3.pptx
Object-oriented programming 3.pptx
Adikhan27
 
OOP interview questions & answers.
OOP interview questions & answers.OOP interview questions & answers.
OOP interview questions & answers.
Questpond
 
Object oriented programming 6 oop with c++
Object oriented programming 6  oop with c++Object oriented programming 6  oop with c++
Object oriented programming 6 oop with c++
Vaibhav Khanna
 
Oop
OopOop
C++ first s lide
C++ first s lideC++ first s lide
C++ first s lide
Sudhriti Gupta
 
Basic concepts of oops
Basic concepts of oopsBasic concepts of oops
Basic concepts of oops
Chandrakiran Satdeve
 

Similar to Oopsinphp (20)

UNIT-IV WT web technology for 1st year cs
UNIT-IV WT web technology for 1st year csUNIT-IV WT web technology for 1st year cs
UNIT-IV WT web technology for 1st year cs
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
 
Php oop (1)
Php oop (1)Php oop (1)
Php oop (1)
 
Introduction to OOP concepts
Introduction to OOP conceptsIntroduction to OOP concepts
Introduction to OOP concepts
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
 
Lecture-10_PHP-OOP.pptx
Lecture-10_PHP-OOP.pptxLecture-10_PHP-OOP.pptx
Lecture-10_PHP-OOP.pptx
 
Principles of OOPs.pptx
Principles of OOPs.pptxPrinciples of OOPs.pptx
Principles of OOPs.pptx
 
Introduction to oop
Introduction to oopIntroduction to oop
Introduction to oop
 
OOPS – General Understanding in .NET
OOPS – General Understanding in .NETOOPS – General Understanding in .NET
OOPS – General Understanding in .NET
 
C#.net interview questions for dynamics 365 ce crm developers
C#.net interview questions for dynamics 365 ce crm developersC#.net interview questions for dynamics 365 ce crm developers
C#.net interview questions for dynamics 365 ce crm developers
 
Lecture 8
Lecture 8Lecture 8
Lecture 8
 
full defination of final opp.pptx
full defination of final opp.pptxfull defination of final opp.pptx
full defination of final opp.pptx
 
Oops
OopsOops
Oops
 
Unit 4
Unit 4Unit 4
Unit 4
 
Object-oriented programming 3.pptx
Object-oriented programming 3.pptxObject-oriented programming 3.pptx
Object-oriented programming 3.pptx
 
OOP interview questions & answers.
OOP interview questions & answers.OOP interview questions & answers.
OOP interview questions & answers.
 
Object oriented programming 6 oop with c++
Object oriented programming 6  oop with c++Object oriented programming 6  oop with c++
Object oriented programming 6 oop with c++
 
Oop
OopOop
Oop
 
C++ first s lide
C++ first s lideC++ first s lide
C++ first s lide
 
Basic concepts of oops
Basic concepts of oopsBasic concepts of oops
Basic concepts of oops
 

Recently uploaded

Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
David Douglas School District
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
Israel Genealogy Research Association
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
PECB
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Excellence Foundation for South Sudan
 
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
RitikBhardwaj56
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
Nicholas Montgomery
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
AyyanKhan40
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
thanhdowork
 
Top five deadliest dog breeds in America
Top five deadliest dog breeds in AmericaTop five deadliest dog breeds in America
Top five deadliest dog breeds in America
Bisnar Chase Personal Injury Attorneys
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
chanes7
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
Celine George
 
How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
Celine George
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
taiba qazi
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
TechSoup
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Akanksha trivedi rama nursing college kanpur.
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
tarandeep35
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
mulvey2
 

Recently uploaded (20)

Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
 
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
 
Top five deadliest dog breeds in America
Top five deadliest dog breeds in AmericaTop five deadliest dog breeds in America
Top five deadliest dog breeds in America
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
 
How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
 

Oopsinphp

  • 2. PAPER NAME : PROGRAMMING IN PHP STAFF NAME : MS.V.SHANTHI M.SC,M.PHIL,M,TECH,PGDCA. CLASS : III BCA SEMESTER : VI
  • 3. Object oriented programming  PHP is a server side scripting language, mainly used for web development but also used as a general proposition programming language. Object Oriented Programming, is a type of programming language principle added to php , that helps in building complex, reusable web applications.
  • 4. OBJECT ORIENTED CONCEPTS • Class • Object • Member Variable • Member Function • Inheritance • Parent Class • Child Class • Polymorphism • Data Abstraction • Encapsulation • Constructor • Destructor
  • 5. Class:  This is a programmer defined data type which inject local functions as well as local data. You can think of a class as a template for making many specimen of the same kind of object.
  • 6. Object:  An single instance of the data structure defined by a class. You define a class once and then make many objects that befit to it. Objects are also known as specimen.
  • 7. Member Variable:  These are the variables defined inside a class. This data will be insensible to the outside of the class and can be accessed via member functions. These variables are called virtue of the object once an object is created.
  • 8. Member function :  These are the function clear inside a class and are used to admission object data. Inheritance:  When a class is defined by inheriting current function of a parent class then it is called inheritance. Here child class will receive all or few member functions and variables of a parent class.
  • 9. Parent class:  A class that is inborn from by another class. This is also called a base class or super class. Child class:  A class that receives from another class. This is also called a subclass or derived class.
  • 10. Polymorphism:  This is an object oriented idea where same function can be used for dissimilar purposes. For example function name will remain same but it take different number of clash and can do different task. Overloading:  A type of polymorphism in which some or all of operators have different implementations build upon on the types of their arguments. Build upon functions can also be overloaded with different implementation.
  • 11. Data Abstraction:  Any representation of data in which the implementation details are occult. Encapsulation:  Refers to a idea where we encapsulate all the data and member functions constant to form an object.
  • 12. Constructor:  Refers to a exceptional type of function which will be called spontaneously whenever there is an object formation from a class. Destructor:  Refers to a exceptional type of function which will be called spontaneously whenever an object is deleted or goes out of scope.
  • 13. PHP: Inheritance • Inheritance is a well-established programming principle. • Inheritance allows classes to form a hierarchy like a family tree. • Allows subclasses to share the techniques and belongings (which are public or protected) of its superclass. • Superclass is the parent class. • A subclass can add properties and methods. • Inheritance allows reusing code.
  • 15. INTERFACES:  An interface is a explanation of the actions that an entity can do.  Interface is written in the similar way as the class the statement with interface keyword.
  • 16. Rules of Interfaces: • All methods professed in an interface must be public; this is the nature of an interface. • All methods in the interface must be applied within a class; failure to do so will result in a fatal error. • The class applying the interface must use the exact same technique signatures as are defined in the interface • Interfaces can be prolonged like classes using the spreads operator.
  • 17. Abstract Classes:  An abstract class is a class that contains at least one abstract technique. The abstract technique is function declaration without anybody and it has the only name of the technique and its parameters.  There can be any number of techniques in the class and we have to announce the class as abstract only when there is an abstract method
  • 18. PHP: Interfaces • Provides methods to implement. • Derived classes may implement more than one interface. • Interfaces may succeed to from other interfaces using the extends keyword. • All techniques are supposed to be public in the interface definition can be defined explicitly as public or implicitly. • When a class equipment multiple interfaces there cannot be any naming collision between methods defined in the different interfaces.
  • 19. PHP: Object Cloning • Cloning is used to produce a copy of an object. • An entity copy is produced by using the clone keyword. • When an entity is cloned, PHP 5 will perform a shallow copy of all of the object's properties. • PHP affords a special method __clone to copy an object. • Once the cloning is complete, if a __clone() method is defined, then the newly created object's __clone() method will be called, to allow any necessary properties that need to be changed.