SlideShare a Scribd company logo
8/16/2013
Mutinda Boniface
Bsc. Information Technology
Computer Society of Kimathi (CSK) PHP MEETUP 2.0
Object Oriented Programming - PHP
OOP- PHP
8/16/2013
OOP? - What comes into your mind ?
1. Class..
2. Object..
1. Class..
2. Object.
3. Inheritance
4. Polymorphism
5. Data Hiding
OOP- PHP
8/16/2013
1. Class – A template that facilitates creation of objects,
- A set of program statements to do a certain task.
- Methods and properties
Example
properties constructor
methods
Represents an entity in a real world
OOP- PHP
8/16/2013
2. Object – Instance of a class
Example
new keyword to denote a new object of the class
object
Calls the class constructor if
It’s defined
OOP- PHP
8/16/2013
3. Inheritance – Parent and a child relationship
- Allows for reusability, extensibility
Nutshell: create a new class based on an existing class and
port in to it new methods and then later on create new
objects based on this class
Example
2 more methods
Inheritance is by the keyword extends in php
OOP- PHP
8/16/2013
4. Polymorphism – Objects react different to the same message
- implemented using keyword interface
- Solution since php doesn’t support multiple
in heritance
Example
Human being is an animal Dog is an animal
Human being can walk + dog can walk and so on….
See walk()
Implementation
for a human being
See walk()
Implementation
for a dog
This models out an animal interface whose methods
are implemented in classes which implements them
OOP- PHP
8/16/2013
5. Data Hiding – Limiting variables within or outside an object
- Demonstrates access control modifiers…
- public, protected, private
Example
See walk()
Implementation
for a human being
See walk()
Implementation
for a dog
This models out an animal interface whose methods
are implemented in classes which implements them
Public: member functions and properties defined as public are accessible
Within and outside the script.
Private: only accessible within the class it is defined in not outside
Protected: accessible within the class it is defined in and the descendants
Of the class.
OOP- PHP
8/16/2013
PHP 5 magic Functions
__get(), __set(), __toString(), __clone(), ………
Example
See walk()
Implementation
for a human being
See walk()
Implementation
for a dog
This models out an animal interface whose methods
are implemented in classes which implements them
__set() - it'll be called automatically by the PHP engine each time a
script attempts to assign a value to a property of a class that hasn't
been explicitly declared.
__get() - the "__get()" function will be invoked transparently when a
script tries to retrieve the value of an undeclared class property as
well.
OOP- PHP
8/16/2013
This models out an animal interface whose methods
are implemented in classes which implements them
1. Class keyword
2. Interface keyword
3. Implements keyword
4. Extends keyword
5. Magic functions __set(), __get(),…..
OOP- PHP
?
8/16/2013
OOP- PHP
8/16/2013
OOP- PHP
Email: boniface.info@gmail.com
Twitter: @webgeeker
Facebook: /mutinda.boniface

More Related Content

PPT
PHP - Introduction to Object Oriented Programming with PHP
Vibrant Technologies & Computers
 
PPT
Oops concepts in php
CPD INDIA
 
PPTX
Object oreinted php | OOPs
Ravi Bhadauria
 
PPT
Oops in PHP
Mindfire Solutions
 
PDF
Fastapi
VikasYadav314092
 
PDF
Php array
Nikul Shah
 
PPTX
PHP OOP Lecture - 01.pptx
Atikur Rahman
 
PPTX
Chapter 05 classes and objects
Praveen M Jigajinni
 
PHP - Introduction to Object Oriented Programming with PHP
Vibrant Technologies & Computers
 
Oops concepts in php
CPD INDIA
 
Object oreinted php | OOPs
Ravi Bhadauria
 
Oops in PHP
Mindfire Solutions
 
Php array
Nikul Shah
 
PHP OOP Lecture - 01.pptx
Atikur Rahman
 
Chapter 05 classes and objects
Praveen M Jigajinni
 

What's hot (20)

PPT
PHP - Introduction to File Handling with PHP
Vibrant Technologies & Computers
 
PPTX
Chapter 2.datatypes and operators
Jasleen Kaur (Chandigarh University)
 
PDF
PYTHON-Chapter 3-Classes and Object-oriented Programming: MAULIK BORSANIYA
Maulik Borsaniya
 
PPTX
Loops in C# for loops while and do while loop.
Abid Kohistani
 
PPT
14 file handling
APU
 
PPTX
SHELL PROGRAMMING
jinal thakrar
 
PPT
File in c
Prabhu Govind
 
PPT
Arrays in php
Laiby Thomas
 
PPTX
Python 101: Python for Absolute Beginners (PyTexas 2014)
Paige Bailey
 
PPT
JQuery introduction
NexThoughts Technologies
 
PPTX
Files in php
sana mateen
 
PDF
HTTP Request and Response Structure
BhagyashreeGajera1
 
PPTX
Introduction to the basics of Python programming (part 1)
Pedro Rodrigues
 
PPSX
Php and MySQL
Tiji Thomas
 
PPTX
Pipes and filters
bhatvijetha
 
PPT
Introduction to oop
Kumar
 
PPTX
Static Data Members and Member Functions
MOHIT AGARWAL
 
PPT
Dom JavaScript
Jorge García C.
 
PPTX
OOP C++
Ahmed Farag
 
PDF
Python programming : Files
Emertxe Information Technologies Pvt Ltd
 
PHP - Introduction to File Handling with PHP
Vibrant Technologies & Computers
 
Chapter 2.datatypes and operators
Jasleen Kaur (Chandigarh University)
 
PYTHON-Chapter 3-Classes and Object-oriented Programming: MAULIK BORSANIYA
Maulik Borsaniya
 
Loops in C# for loops while and do while loop.
Abid Kohistani
 
14 file handling
APU
 
SHELL PROGRAMMING
jinal thakrar
 
File in c
Prabhu Govind
 
Arrays in php
Laiby Thomas
 
Python 101: Python for Absolute Beginners (PyTexas 2014)
Paige Bailey
 
JQuery introduction
NexThoughts Technologies
 
Files in php
sana mateen
 
HTTP Request and Response Structure
BhagyashreeGajera1
 
Introduction to the basics of Python programming (part 1)
Pedro Rodrigues
 
Php and MySQL
Tiji Thomas
 
Pipes and filters
bhatvijetha
 
Introduction to oop
Kumar
 
Static Data Members and Member Functions
MOHIT AGARWAL
 
Dom JavaScript
Jorge García C.
 
OOP C++
Ahmed Farag
 
Python programming : Files
Emertxe Information Technologies Pvt Ltd
 
Ad

Viewers also liked (20)

ODP
Beginners Guide to Object Orientation in PHP
Rick Ogden
 
PDF
Threads in PHP - Presentation
appserver.io
 
PPT
Core Php Component Presentation
John Coonen
 
PPTX
PHP
Jawhar Ali
 
PPTX
PHP in one presentation
Milad Rahimi
 
PDF
Beginning OOP in PHP
David Stockton
 
PPTX
PHP presentation - Com 585
jstout007
 
PDF
Devise | Presentation for Alpharetta PHP / Laravel Group
Gary Williams
 
PPTX
PHP presentation
Helen Pitlick
 
PDF
Object Oriented Programming in PHP
Lorna Mitchell
 
ODP
Internationalisation with PHP and Intl
Daniel_Rhodes
 
PDF
Lean Php Presentation
Alan Pinstein
 
ODP
Introduction of Html/css/js
Knoldus Inc.
 
DOC
Creating a Simple PHP and MySQL-Based Login System
Azharul Haque Shohan
 
PPTX
Php string function
Ravi Bhadauria
 
PDF
PHP Tour 2016 Phinx Presentation
Rob Morgan
 
PPT
Oop Presentation
Ghaffar Khan
 
PPSX
Php string
argusacademy
 
Beginners Guide to Object Orientation in PHP
Rick Ogden
 
Threads in PHP - Presentation
appserver.io
 
Core Php Component Presentation
John Coonen
 
PHP in one presentation
Milad Rahimi
 
Beginning OOP in PHP
David Stockton
 
PHP presentation - Com 585
jstout007
 
Devise | Presentation for Alpharetta PHP / Laravel Group
Gary Williams
 
PHP presentation
Helen Pitlick
 
Object Oriented Programming in PHP
Lorna Mitchell
 
Internationalisation with PHP and Intl
Daniel_Rhodes
 
Lean Php Presentation
Alan Pinstein
 
Introduction of Html/css/js
Knoldus Inc.
 
Creating a Simple PHP and MySQL-Based Login System
Azharul Haque Shohan
 
Php string function
Ravi Bhadauria
 
PHP Tour 2016 Phinx Presentation
Rob Morgan
 
Oop Presentation
Ghaffar Khan
 
Php string
argusacademy
 
Ad

Similar to Php oop presentation (20)

PPTX
Lecture-10_PHP-OOP.pptx
ShaownRoy1
 
PPT
PHP-05-Objects.ppt
rani marri
 
PPT
PHP- Introduction to Object Oriented PHP
Vibrant Technologies & Computers
 
PDF
Object Oriented PHP - PART-1
Jalpesh Vasa
 
PDF
Intro Oop
Kamatchi Selvam
 
PPTX
Introduction to PHP and MySql basics.pptx
PriyankaKupneshi
 
PPTX
Intro to OOP PHP and Github
Jo Erik San Jose
 
PPTX
Oopsinphp
NithyaNithyav
 
PDF
OOP in PHP
Tarek Mahmud Apu
 
PPTX
UNIT III (8).pptx
DrDhivyaaCRAssistant
 
PPTX
UNIT III (8).pptx
DrDhivyaaCRAssistant
 
PPTX
Object Oriented PHP by Dr.C.R.Dhivyaa Kongu Engineering College
Dhivyaa C.R
 
PDF
09 Object Oriented Programming in PHP #burningkeyboards
Denis Ristic
 
DOCX
Oops concept in php
selvabalaji k
 
PPTX
Object oriented programming in php
Aashiq Kuchey
 
PDF
A Gentle Introduction To Object Oriented Php
Michael Girouard
 
PPT
Php object orientation and classes
Kumar
 
PPTX
Oops in php
Gourishankar R Pujar
 
PPT
SQL Devlopment for 10 ppt
Tanay Kishore Mishra
 
PDF
Oop in php_tutorial
Gregory Hanis
 
Lecture-10_PHP-OOP.pptx
ShaownRoy1
 
PHP-05-Objects.ppt
rani marri
 
PHP- Introduction to Object Oriented PHP
Vibrant Technologies & Computers
 
Object Oriented PHP - PART-1
Jalpesh Vasa
 
Intro Oop
Kamatchi Selvam
 
Introduction to PHP and MySql basics.pptx
PriyankaKupneshi
 
Intro to OOP PHP and Github
Jo Erik San Jose
 
Oopsinphp
NithyaNithyav
 
OOP in PHP
Tarek Mahmud Apu
 
UNIT III (8).pptx
DrDhivyaaCRAssistant
 
UNIT III (8).pptx
DrDhivyaaCRAssistant
 
Object Oriented PHP by Dr.C.R.Dhivyaa Kongu Engineering College
Dhivyaa C.R
 
09 Object Oriented Programming in PHP #burningkeyboards
Denis Ristic
 
Oops concept in php
selvabalaji k
 
Object oriented programming in php
Aashiq Kuchey
 
A Gentle Introduction To Object Oriented Php
Michael Girouard
 
Php object orientation and classes
Kumar
 
SQL Devlopment for 10 ppt
Tanay Kishore Mishra
 
Oop in php_tutorial
Gregory Hanis
 

Recently uploaded (20)

PPTX
Software Engineering BSC DS UNIT 1 .pptx
Dr. Pallawi Bulakh
 
PDF
Phylum Arthropoda: Characteristics and Classification, Entomology Lecture
Miraj Khan
 
PDF
5.Universal-Franchise-and-Indias-Electoral-System.pdfppt/pdf/8th class social...
Sandeep Swamy
 
PPTX
IMMUNIZATION PROGRAMME pptx
AneetaSharma15
 
PPTX
Open Quiz Monsoon Mind Game Prelims.pptx
Sourav Kr Podder
 
PDF
Arihant Class 10 All in One Maths full pdf
sajal kumar
 
PPTX
Dakar Framework Education For All- 2000(Act)
santoshmohalik1
 
PPTX
HISTORY COLLECTION FOR PSYCHIATRIC PATIENTS.pptx
PoojaSen20
 
PPTX
Open Quiz Monsoon Mind Game Final Set.pptx
Sourav Kr Podder
 
PPTX
How to Manage Leads in Odoo 18 CRM - Odoo Slides
Celine George
 
PPTX
NOI Hackathon - Summer Edition - GreenThumber.pptx
MartinaBurlando1
 
PDF
UTS Health Student Promotional Representative_Position Description.pdf
Faculty of Health, University of Technology Sydney
 
PPTX
Introduction and Scope of Bichemistry.pptx
shantiyogi
 
PPTX
Week 4 Term 3 Study Techniques revisited.pptx
mansk2
 
PDF
Module 3: Health Systems Tutorial Slides S2 2025
Jonathan Hallett
 
PDF
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
Mithil Fal Desai
 
PDF
Mga Unang Hakbang Tungo Sa Tao by Joe Vibar Nero.pdf
MariellaTBesana
 
PPTX
Tips Management in Odoo 18 POS - Odoo Slides
Celine George
 
DOCX
UPPER GASTRO INTESTINAL DISORDER.docx
BANDITA PATRA
 
PDF
The Minister of Tourism, Culture and Creative Arts, Abla Dzifa Gomashie has e...
nservice241
 
Software Engineering BSC DS UNIT 1 .pptx
Dr. Pallawi Bulakh
 
Phylum Arthropoda: Characteristics and Classification, Entomology Lecture
Miraj Khan
 
5.Universal-Franchise-and-Indias-Electoral-System.pdfppt/pdf/8th class social...
Sandeep Swamy
 
IMMUNIZATION PROGRAMME pptx
AneetaSharma15
 
Open Quiz Monsoon Mind Game Prelims.pptx
Sourav Kr Podder
 
Arihant Class 10 All in One Maths full pdf
sajal kumar
 
Dakar Framework Education For All- 2000(Act)
santoshmohalik1
 
HISTORY COLLECTION FOR PSYCHIATRIC PATIENTS.pptx
PoojaSen20
 
Open Quiz Monsoon Mind Game Final Set.pptx
Sourav Kr Podder
 
How to Manage Leads in Odoo 18 CRM - Odoo Slides
Celine George
 
NOI Hackathon - Summer Edition - GreenThumber.pptx
MartinaBurlando1
 
UTS Health Student Promotional Representative_Position Description.pdf
Faculty of Health, University of Technology Sydney
 
Introduction and Scope of Bichemistry.pptx
shantiyogi
 
Week 4 Term 3 Study Techniques revisited.pptx
mansk2
 
Module 3: Health Systems Tutorial Slides S2 2025
Jonathan Hallett
 
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
Mithil Fal Desai
 
Mga Unang Hakbang Tungo Sa Tao by Joe Vibar Nero.pdf
MariellaTBesana
 
Tips Management in Odoo 18 POS - Odoo Slides
Celine George
 
UPPER GASTRO INTESTINAL DISORDER.docx
BANDITA PATRA
 
The Minister of Tourism, Culture and Creative Arts, Abla Dzifa Gomashie has e...
nservice241
 

Php oop presentation

  • 1. 8/16/2013 Mutinda Boniface Bsc. Information Technology Computer Society of Kimathi (CSK) PHP MEETUP 2.0 Object Oriented Programming - PHP OOP- PHP
  • 2. 8/16/2013 OOP? - What comes into your mind ? 1. Class.. 2. Object.. 1. Class.. 2. Object. 3. Inheritance 4. Polymorphism 5. Data Hiding OOP- PHP
  • 3. 8/16/2013 1. Class – A template that facilitates creation of objects, - A set of program statements to do a certain task. - Methods and properties Example properties constructor methods Represents an entity in a real world OOP- PHP
  • 4. 8/16/2013 2. Object – Instance of a class Example new keyword to denote a new object of the class object Calls the class constructor if It’s defined OOP- PHP
  • 5. 8/16/2013 3. Inheritance – Parent and a child relationship - Allows for reusability, extensibility Nutshell: create a new class based on an existing class and port in to it new methods and then later on create new objects based on this class Example 2 more methods Inheritance is by the keyword extends in php OOP- PHP
  • 6. 8/16/2013 4. Polymorphism – Objects react different to the same message - implemented using keyword interface - Solution since php doesn’t support multiple in heritance Example Human being is an animal Dog is an animal Human being can walk + dog can walk and so on…. See walk() Implementation for a human being See walk() Implementation for a dog This models out an animal interface whose methods are implemented in classes which implements them OOP- PHP
  • 7. 8/16/2013 5. Data Hiding – Limiting variables within or outside an object - Demonstrates access control modifiers… - public, protected, private Example See walk() Implementation for a human being See walk() Implementation for a dog This models out an animal interface whose methods are implemented in classes which implements them Public: member functions and properties defined as public are accessible Within and outside the script. Private: only accessible within the class it is defined in not outside Protected: accessible within the class it is defined in and the descendants Of the class. OOP- PHP
  • 8. 8/16/2013 PHP 5 magic Functions __get(), __set(), __toString(), __clone(), ……… Example See walk() Implementation for a human being See walk() Implementation for a dog This models out an animal interface whose methods are implemented in classes which implements them __set() - it'll be called automatically by the PHP engine each time a script attempts to assign a value to a property of a class that hasn't been explicitly declared. __get() - the "__get()" function will be invoked transparently when a script tries to retrieve the value of an undeclared class property as well. OOP- PHP
  • 9. 8/16/2013 This models out an animal interface whose methods are implemented in classes which implements them 1. Class keyword 2. Interface keyword 3. Implements keyword 4. Extends keyword 5. Magic functions __set(), __get(),….. OOP- PHP
  • 11. 8/16/2013 OOP- PHP Email: [email protected] Twitter: @webgeeker Facebook: /mutinda.boniface