SlideShare une entreprise Scribd logo
1  sur  50
Why PHP?
What does PHP stand for?
 Personal Homepage

 PHP: Hypertext Preprocessor (recursive acronym)
 Created by Rasmus Lerdorf (1994)
It’s FREE!!

 PHP is open-source
Platform Independent
 Can be deployed/installed in different OS
Great Documentation

 php.net
 Functions are well explained + informative

examples
Large and Active Community

 stackoverflow
 php.net
 github
 Etc...
Easy to learn

 Simple syntax
 Well documented
 Lots of tutorials everywhere
 Lots of premade libraries
WHY PHP
 It’s Free
 Platform Independent

 Great Documentation
 Large and Active Community
 Easy to learn
OBJECT ORIENTED
PROGRAMMING
Object Oriented Programming
 A programming concept that treats functions and

data as objects.
 A programming methodology based on objects,
instead of functions and procedures.
“I explain that procedural program is built around
the "verbs" of the system, the things you want the
system to do, whereas object-oriented
programming is build about the "nouns," the
things in the system, and what they are capable
of.”
Object and Class
CLASS
 is a "template"/"blueprint" that is used to

create objects
 usually represents a noun, such as person, place or
thing.
CLASS

class PointGuard
{
}
OBJECT
 In real world object is a material thing that can be

seen and touched.
 In OOP, object is a self-contained entity that
consist of both data and procedures.
 An instance of a class
Give examples of real life class and object.
INSTANCE
INSTANCE
 layman's term - a case or occurrence of anything
 a single copy of an object, there might be one or

several objects, but an instance is a specific copy,
to which you can have a reference
$instance = new PointGuard();
INHERITANCE
INHERITANCE
 biology - the genetic characters transmitted from

parents to offspring
 OOP - provides reusability of codes. We can add
additional codes to an existing class without
modifying it.
 can be defined as the process of one object
acquires the properties of another by making
subclasses (parent-child relationship)
INHERITANCE
<?php
class BasketballPosition
{
// some methods and properties
}
class PointGuard extends BasketballPosition
{
// some methods and properties
}
Give examples of inheritance.
Class Properties and Methods
 Height
 Weight
 Pass
 Dribble
 Shoot
 Rebound
 Block
Class Properties
 also know as data members and is used to hold

data of a class.
 The data that it holds are specific to the nature of
the class in which it has been defined.
Class Properties
class PointGuard
{
public $name;
public $ball_handling_level;
}
Class Methods
 functions that are associated with the class
 functions that can be involve in the class property

processing
Class Methods
class PointGuard
{
public $name;
public $ball_handling_level;

public function createPlay()
{
// some processing here
}
}
Encapsulation
Encapsulation
 facilitates the bundling of data with

the methods (or other functions) operating on that
data.
 restricting access to some of the object’s
components.
 used to hide the values or state of a structured data
object inside a class, preventing unauthorized
parties' direct access to them.
Encapsulation
Example :
Courting a girl
Encapsulation
 Access modifiers/Visibility

private
 property and method can be accessed only inside the
class itself and can't be accessed anywhere else
 protected
 property and method can be accessed only inside the
class itself and inside child classes.
 public
 allows the property/method to be accessed from
anywhere of code

Private
class Love
{
private $hearbeat_per_second = 100;
public function getHeartBeatPerSec()
{
return $this->heartbeat_per_second;
}
}
class Valentines extends Love
{
public function getHeartBeatPerSecWhenNear()
{
return $this->heartbeat_per_second * 2; // will produce an error
}
}
$love = new Love();
echo $love->getHeartBeatPerSec(); // will output 100
echo $love->heartbeat_per_second; // will produce an error
Protected
class Love
{
protected $hearbeat_per_second = 100;
public function getHeartBeatPerSec()
{
return $this->heartbeat_per_second;
}
}
class Valentines extends Love
{
public function getHeartBeatPerSecWhenNear()
{
return $this->heartbeat_per_second * 2; // will return 200
}
}
$love = new Love();
echo $love->getHeartBeatPerSec(); // will output 100
echo $love->heartbeat_per_second; // will produce an error
Public
class Love
{
public $hearbeat_per_second = 100;
public function getHeartBeatPerSec()
{
return $this->heartbeat_per_second;
}
}
class Valentines extends Love
{
public function getHeartBeatPerSecWhenNear()
{
return $this->heartbeat_per_second * 2; // will return 200
}
}
$love = new Love();
echo $love->getHeartBeatPerSec(); // will output 100
echo $love->heartbeat_per_second; // will output 100
Choosing the Right Visibility
START

Accessed
externally?

Y

public

N
Deny to
children?
N
protected

Y

private
PHP OOP
 Object and Class
 Instance

 Inheritance
 Class Properties and Methods
 Encapsulation
Introduction to Git and Github
Git whhaaat???
 Is a source/version control management software.
 Is a software that allows you to track the changes

that you make to individual files.
Github eeeeee??
 is a web-based hosting service for software

development projects that use the Git revision
control system
 “social coding”
Why u no use git and github??
Why u no use git and github??
 Git can track your changes to your projects.

 You can go back to a certain change you made that

you want to recover.
Why u no use git and github??
Why u no use git and github??
 Github lets you collaborate with other developers

or your project teammates by adding comments or
suggestions on commits.
 You can also contribute to public/open source
projects. (eg. Facebook SDK, Codeigniter, PHP,
etc...)
 Share your codes to public and get feedback from
large community of developers.
Why u no use git and github??
Why u no use git and github??
Commands Overview
 git init

Initializes a git repository.
git status
 Check your changes made (untracked files, modified files, staged files)
git commit
 Save your changes into one commit history.
git push
 Push your changes in the remote repository.
git pull
 Pull changes from remote repository and apply it to your local repository.
git fetch
 Fetch changes from remote repository but changes will not apply to your
local repository







Git and Github
 Git and github can be effectively used in project

collaborations.
 Can improve a developer’s coding.
 Can avoid overriding or duplicating codes
 Not just a developer tool
“Whenever you are asked if you can do a job,
tell'em, Certainly, I can! Then get busy and find
out how to do it.”
- Theodore Roosevelt
Intro to OOP PHP and Github

Contenu connexe

Tendances

Object oriented programming in php 5
Object oriented programming in php 5Object oriented programming in php 5
Object oriented programming in php 5Sayed Ahmed
 
Intro to OOP and new features in PHP 5.3
Intro to OOP and new features in PHP 5.3Intro to OOP and new features in PHP 5.3
Intro to OOP and new features in PHP 5.3Adam Culp
 
Oop in-php
Oop in-phpOop in-php
Oop in-phpRajesh S
 
A Gentle Introduction To Object Oriented Php
A Gentle Introduction To Object Oriented PhpA Gentle Introduction To Object Oriented Php
A Gentle Introduction To Object Oriented PhpMichael Girouard
 
Class 7 - PHP Object Oriented Programming
Class 7 - PHP Object Oriented ProgrammingClass 7 - PHP Object Oriented Programming
Class 7 - PHP Object Oriented ProgrammingAhmed Swilam
 
PHP - Introduction to Object Oriented Programming with PHP
PHP -  Introduction to  Object Oriented Programming with PHPPHP -  Introduction to  Object Oriented Programming with PHP
PHP - Introduction to Object Oriented Programming with PHPVibrant Technologies & Computers
 
09 Object Oriented Programming in PHP #burningkeyboards
09 Object Oriented Programming in PHP #burningkeyboards09 Object Oriented Programming in PHP #burningkeyboards
09 Object Oriented Programming in PHP #burningkeyboardsDenis Ristic
 
Object Oriented Programming in PHP
Object Oriented Programming in PHPObject Oriented Programming in PHP
Object Oriented Programming in PHPLorna Mitchell
 
Object Oriented PHP5
Object Oriented PHP5Object Oriented PHP5
Object Oriented PHP5Jason Austin
 
Intermediate OOP in PHP
Intermediate OOP in PHPIntermediate OOP in PHP
Intermediate OOP in PHPDavid Stockton
 
Class and Objects in PHP
Class and Objects in PHPClass and Objects in PHP
Class and Objects in PHPRamasubbu .P
 
Basics of Object Oriented Programming in Python
Basics of Object Oriented Programming in PythonBasics of Object Oriented Programming in Python
Basics of Object Oriented Programming in PythonSujith Kumar
 

Tendances (20)

Php Oop
Php OopPhp Oop
Php Oop
 
Oops in PHP
Oops in PHPOops in PHP
Oops in PHP
 
Object oriented programming in php 5
Object oriented programming in php 5Object oriented programming in php 5
Object oriented programming in php 5
 
Intro to OOP and new features in PHP 5.3
Intro to OOP and new features in PHP 5.3Intro to OOP and new features in PHP 5.3
Intro to OOP and new features in PHP 5.3
 
Oop in-php
Oop in-phpOop in-php
Oop in-php
 
PHP Classes and OOPS Concept
PHP Classes and OOPS ConceptPHP Classes and OOPS Concept
PHP Classes and OOPS Concept
 
A Gentle Introduction To Object Oriented Php
A Gentle Introduction To Object Oriented PhpA Gentle Introduction To Object Oriented Php
A Gentle Introduction To Object Oriented Php
 
Class 7 - PHP Object Oriented Programming
Class 7 - PHP Object Oriented ProgrammingClass 7 - PHP Object Oriented Programming
Class 7 - PHP Object Oriented Programming
 
PHP- Introduction to Object Oriented PHP
PHP-  Introduction to Object Oriented PHPPHP-  Introduction to Object Oriented PHP
PHP- Introduction to Object Oriented PHP
 
OOPS Characteristics (With Examples in PHP)
OOPS Characteristics (With Examples in PHP)OOPS Characteristics (With Examples in PHP)
OOPS Characteristics (With Examples in PHP)
 
PHP - Introduction to Object Oriented Programming with PHP
PHP -  Introduction to  Object Oriented Programming with PHPPHP -  Introduction to  Object Oriented Programming with PHP
PHP - Introduction to Object Oriented Programming with PHP
 
09 Object Oriented Programming in PHP #burningkeyboards
09 Object Oriented Programming in PHP #burningkeyboards09 Object Oriented Programming in PHP #burningkeyboards
09 Object Oriented Programming in PHP #burningkeyboards
 
Introduction to php oop
Introduction to php oopIntroduction to php oop
Introduction to php oop
 
Object Oriented Programming in PHP
Object Oriented Programming in PHPObject Oriented Programming in PHP
Object Oriented Programming in PHP
 
Oops in php
Oops in phpOops in php
Oops in php
 
Object Oriented PHP5
Object Oriented PHP5Object Oriented PHP5
Object Oriented PHP5
 
Php oop (1)
Php oop (1)Php oop (1)
Php oop (1)
 
Intermediate OOP in PHP
Intermediate OOP in PHPIntermediate OOP in PHP
Intermediate OOP in PHP
 
Class and Objects in PHP
Class and Objects in PHPClass and Objects in PHP
Class and Objects in PHP
 
Basics of Object Oriented Programming in Python
Basics of Object Oriented Programming in PythonBasics of Object Oriented Programming in Python
Basics of Object Oriented Programming in Python
 

En vedette

Intermediate oop in php
Intermediate oop in phpIntermediate oop in php
Intermediate oop in phpDavid Stockton
 
Object oriented programming (oop) cs304 power point slides lecture 01
Object oriented programming (oop)   cs304 power point slides lecture 01Object oriented programming (oop)   cs304 power point slides lecture 01
Object oriented programming (oop) cs304 power point slides lecture 01Adil Kakakhel
 
Basic concepts of object oriented programming
Basic concepts of object oriented programmingBasic concepts of object oriented programming
Basic concepts of object oriented programmingSachin Sharma
 
Introduction to Object Oriented Programming
Introduction to Object Oriented ProgrammingIntroduction to Object Oriented Programming
Introduction to Object Oriented ProgrammingMoutaz Haddara
 
Object Oriented Programming Concepts
Object Oriented Programming ConceptsObject Oriented Programming Concepts
Object Oriented Programming Conceptsthinkphp
 
AI, Blockchain, IOT, Evolution or Singularity? Digital Identity And Digital ...
AI, Blockchain, IOT,  Evolution or Singularity? Digital Identity And Digital ...AI, Blockchain, IOT,  Evolution or Singularity? Digital Identity And Digital ...
AI, Blockchain, IOT, Evolution or Singularity? Digital Identity And Digital ...Dinis Guarda
 

En vedette (7)

Intermediate oop in php
Intermediate oop in phpIntermediate oop in php
Intermediate oop in php
 
Beginning OOP in PHP
Beginning OOP in PHPBeginning OOP in PHP
Beginning OOP in PHP
 
Object oriented programming (oop) cs304 power point slides lecture 01
Object oriented programming (oop)   cs304 power point slides lecture 01Object oriented programming (oop)   cs304 power point slides lecture 01
Object oriented programming (oop) cs304 power point slides lecture 01
 
Basic concepts of object oriented programming
Basic concepts of object oriented programmingBasic concepts of object oriented programming
Basic concepts of object oriented programming
 
Introduction to Object Oriented Programming
Introduction to Object Oriented ProgrammingIntroduction to Object Oriented Programming
Introduction to Object Oriented Programming
 
Object Oriented Programming Concepts
Object Oriented Programming ConceptsObject Oriented Programming Concepts
Object Oriented Programming Concepts
 
AI, Blockchain, IOT, Evolution or Singularity? Digital Identity And Digital ...
AI, Blockchain, IOT,  Evolution or Singularity? Digital Identity And Digital ...AI, Blockchain, IOT,  Evolution or Singularity? Digital Identity And Digital ...
AI, Blockchain, IOT, Evolution or Singularity? Digital Identity And Digital ...
 

Similaire à Intro to OOP PHP and Github

Lecture-10_PHP-OOP.pptx
Lecture-10_PHP-OOP.pptxLecture-10_PHP-OOP.pptx
Lecture-10_PHP-OOP.pptxShaownRoy1
 
Demystifying Object-Oriented Programming - PHP UK Conference 2017
Demystifying Object-Oriented Programming - PHP UK Conference 2017Demystifying Object-Oriented Programming - PHP UK Conference 2017
Demystifying Object-Oriented Programming - PHP UK Conference 2017Alena Holligan
 
Demystifying Object-Oriented Programming #ssphp16
Demystifying Object-Oriented Programming #ssphp16Demystifying Object-Oriented Programming #ssphp16
Demystifying Object-Oriented Programming #ssphp16Alena Holligan
 
Take the Plunge with OOP from #pnwphp
Take the Plunge with OOP from #pnwphpTake the Plunge with OOP from #pnwphp
Take the Plunge with OOP from #pnwphpAlena Holligan
 
Demystifying Object-Oriented Programming - PHP[tek] 2017
Demystifying Object-Oriented Programming - PHP[tek] 2017Demystifying Object-Oriented Programming - PHP[tek] 2017
Demystifying Object-Oriented Programming - PHP[tek] 2017Alena Holligan
 
Demystifying Object-Oriented Programming #phpbnl18
Demystifying Object-Oriented Programming #phpbnl18Demystifying Object-Oriented Programming #phpbnl18
Demystifying Object-Oriented Programming #phpbnl18Alena Holligan
 
OOPS IN PHP.pptx
OOPS IN PHP.pptxOOPS IN PHP.pptx
OOPS IN PHP.pptxrani marri
 
Demystifying Object-Oriented Programming - ZendCon 2016
Demystifying Object-Oriented Programming - ZendCon 2016Demystifying Object-Oriented Programming - ZendCon 2016
Demystifying Object-Oriented Programming - ZendCon 2016Alena Holligan
 
Dependency Injection for PHP
Dependency Injection for PHPDependency Injection for PHP
Dependency Injection for PHPmtoppa
 
Basic Oops concept of PHP
Basic Oops concept of PHPBasic Oops concept of PHP
Basic Oops concept of PHPRohan Sharma
 
Objects, Testing, and Responsibility
Objects, Testing, and ResponsibilityObjects, Testing, and Responsibility
Objects, Testing, and Responsibilitymachuga
 
Demystifying Object-Oriented Programming - Lone Star PHP
Demystifying Object-Oriented Programming - Lone Star PHPDemystifying Object-Oriented Programming - Lone Star PHP
Demystifying Object-Oriented Programming - Lone Star PHPAlena Holligan
 
Object Oriented PHP by Dr.C.R.Dhivyaa Kongu Engineering College
Object Oriented PHP by Dr.C.R.Dhivyaa Kongu Engineering CollegeObject Oriented PHP by Dr.C.R.Dhivyaa Kongu Engineering College
Object Oriented PHP by Dr.C.R.Dhivyaa Kongu Engineering CollegeDhivyaa C.R
 

Similaire à Intro to OOP PHP and Github (20)

Lecture-10_PHP-OOP.pptx
Lecture-10_PHP-OOP.pptxLecture-10_PHP-OOP.pptx
Lecture-10_PHP-OOP.pptx
 
Demystifying Object-Oriented Programming - PHP UK Conference 2017
Demystifying Object-Oriented Programming - PHP UK Conference 2017Demystifying Object-Oriented Programming - PHP UK Conference 2017
Demystifying Object-Oriented Programming - PHP UK Conference 2017
 
Demystifying Object-Oriented Programming #ssphp16
Demystifying Object-Oriented Programming #ssphp16Demystifying Object-Oriented Programming #ssphp16
Demystifying Object-Oriented Programming #ssphp16
 
Only oop
Only oopOnly oop
Only oop
 
Take the Plunge with OOP from #pnwphp
Take the Plunge with OOP from #pnwphpTake the Plunge with OOP from #pnwphp
Take the Plunge with OOP from #pnwphp
 
Demystifying Object-Oriented Programming - PHP[tek] 2017
Demystifying Object-Oriented Programming - PHP[tek] 2017Demystifying Object-Oriented Programming - PHP[tek] 2017
Demystifying Object-Oriented Programming - PHP[tek] 2017
 
Demystifying Object-Oriented Programming #phpbnl18
Demystifying Object-Oriented Programming #phpbnl18Demystifying Object-Oriented Programming #phpbnl18
Demystifying Object-Oriented Programming #phpbnl18
 
OOPS IN PHP.pptx
OOPS IN PHP.pptxOOPS IN PHP.pptx
OOPS IN PHP.pptx
 
Demystifying Object-Oriented Programming - ZendCon 2016
Demystifying Object-Oriented Programming - ZendCon 2016Demystifying Object-Oriented Programming - ZendCon 2016
Demystifying Object-Oriented Programming - ZendCon 2016
 
Dependency Injection for PHP
Dependency Injection for PHPDependency Injection for PHP
Dependency Injection for PHP
 
Best practices tekx
Best practices tekxBest practices tekx
Best practices tekx
 
Ch8(oop)
Ch8(oop)Ch8(oop)
Ch8(oop)
 
Basic Oops concept of PHP
Basic Oops concept of PHPBasic Oops concept of PHP
Basic Oops concept of PHP
 
Objects, Testing, and Responsibility
Objects, Testing, and ResponsibilityObjects, Testing, and Responsibility
Objects, Testing, and Responsibility
 
Introduction Php
Introduction PhpIntroduction Php
Introduction Php
 
Reflection-In-PHP
Reflection-In-PHPReflection-In-PHP
Reflection-In-PHP
 
Demystifying Object-Oriented Programming - Lone Star PHP
Demystifying Object-Oriented Programming - Lone Star PHPDemystifying Object-Oriented Programming - Lone Star PHP
Demystifying Object-Oriented Programming - Lone Star PHP
 
UNIT III (8).pptx
UNIT III (8).pptxUNIT III (8).pptx
UNIT III (8).pptx
 
UNIT III (8).pptx
UNIT III (8).pptxUNIT III (8).pptx
UNIT III (8).pptx
 
Object Oriented PHP by Dr.C.R.Dhivyaa Kongu Engineering College
Object Oriented PHP by Dr.C.R.Dhivyaa Kongu Engineering CollegeObject Oriented PHP by Dr.C.R.Dhivyaa Kongu Engineering College
Object Oriented PHP by Dr.C.R.Dhivyaa Kongu Engineering College
 

Dernier

Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsKarakKing
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the ClassroomPooky Knightsmith
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxVishalSingh1417
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structuredhanjurrannsibayan2
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024Elizabeth Walsh
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseAnaAcapella
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxVishalSingh1417
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxEsquimalt MFRC
 

Dernier (20)

Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 

Intro to OOP PHP and Github

  • 2. What does PHP stand for?  Personal Homepage  PHP: Hypertext Preprocessor (recursive acronym)  Created by Rasmus Lerdorf (1994)
  • 3. It’s FREE!!  PHP is open-source
  • 4. Platform Independent  Can be deployed/installed in different OS
  • 5. Great Documentation  php.net  Functions are well explained + informative examples
  • 6. Large and Active Community  stackoverflow  php.net  github  Etc...
  • 7. Easy to learn  Simple syntax  Well documented  Lots of tutorials everywhere  Lots of premade libraries
  • 8. WHY PHP  It’s Free  Platform Independent  Great Documentation  Large and Active Community  Easy to learn
  • 10. Object Oriented Programming  A programming concept that treats functions and data as objects.  A programming methodology based on objects, instead of functions and procedures.
  • 11. “I explain that procedural program is built around the "verbs" of the system, the things you want the system to do, whereas object-oriented programming is build about the "nouns," the things in the system, and what they are capable of.”
  • 13. CLASS  is a "template"/"blueprint" that is used to create objects  usually represents a noun, such as person, place or thing.
  • 15. OBJECT  In real world object is a material thing that can be seen and touched.  In OOP, object is a self-contained entity that consist of both data and procedures.  An instance of a class
  • 16. Give examples of real life class and object.
  • 18. INSTANCE  layman's term - a case or occurrence of anything  a single copy of an object, there might be one or several objects, but an instance is a specific copy, to which you can have a reference
  • 19. $instance = new PointGuard();
  • 21. INHERITANCE  biology - the genetic characters transmitted from parents to offspring  OOP - provides reusability of codes. We can add additional codes to an existing class without modifying it.  can be defined as the process of one object acquires the properties of another by making subclasses (parent-child relationship)
  • 22. INHERITANCE <?php class BasketballPosition { // some methods and properties } class PointGuard extends BasketballPosition { // some methods and properties }
  • 23. Give examples of inheritance.
  • 24. Class Properties and Methods  Height  Weight  Pass  Dribble  Shoot  Rebound  Block
  • 25. Class Properties  also know as data members and is used to hold data of a class.  The data that it holds are specific to the nature of the class in which it has been defined.
  • 26. Class Properties class PointGuard { public $name; public $ball_handling_level; }
  • 27. Class Methods  functions that are associated with the class  functions that can be involve in the class property processing
  • 28. Class Methods class PointGuard { public $name; public $ball_handling_level; public function createPlay() { // some processing here } }
  • 30. Encapsulation  facilitates the bundling of data with the methods (or other functions) operating on that data.  restricting access to some of the object’s components.  used to hide the values or state of a structured data object inside a class, preventing unauthorized parties' direct access to them.
  • 32. Encapsulation  Access modifiers/Visibility private  property and method can be accessed only inside the class itself and can't be accessed anywhere else  protected  property and method can be accessed only inside the class itself and inside child classes.  public  allows the property/method to be accessed from anywhere of code 
  • 33. Private class Love { private $hearbeat_per_second = 100; public function getHeartBeatPerSec() { return $this->heartbeat_per_second; } } class Valentines extends Love { public function getHeartBeatPerSecWhenNear() { return $this->heartbeat_per_second * 2; // will produce an error } } $love = new Love(); echo $love->getHeartBeatPerSec(); // will output 100 echo $love->heartbeat_per_second; // will produce an error
  • 34. Protected class Love { protected $hearbeat_per_second = 100; public function getHeartBeatPerSec() { return $this->heartbeat_per_second; } } class Valentines extends Love { public function getHeartBeatPerSecWhenNear() { return $this->heartbeat_per_second * 2; // will return 200 } } $love = new Love(); echo $love->getHeartBeatPerSec(); // will output 100 echo $love->heartbeat_per_second; // will produce an error
  • 35. Public class Love { public $hearbeat_per_second = 100; public function getHeartBeatPerSec() { return $this->heartbeat_per_second; } } class Valentines extends Love { public function getHeartBeatPerSecWhenNear() { return $this->heartbeat_per_second * 2; // will return 200 } } $love = new Love(); echo $love->getHeartBeatPerSec(); // will output 100 echo $love->heartbeat_per_second; // will output 100
  • 36. Choosing the Right Visibility START Accessed externally? Y public N Deny to children? N protected Y private
  • 37. PHP OOP  Object and Class  Instance  Inheritance  Class Properties and Methods  Encapsulation
  • 38. Introduction to Git and Github
  • 39. Git whhaaat???  Is a source/version control management software.  Is a software that allows you to track the changes that you make to individual files.
  • 40. Github eeeeee??  is a web-based hosting service for software development projects that use the Git revision control system  “social coding”
  • 41. Why u no use git and github??
  • 42. Why u no use git and github??  Git can track your changes to your projects.  You can go back to a certain change you made that you want to recover.
  • 43. Why u no use git and github??
  • 44. Why u no use git and github??  Github lets you collaborate with other developers or your project teammates by adding comments or suggestions on commits.  You can also contribute to public/open source projects. (eg. Facebook SDK, Codeigniter, PHP, etc...)  Share your codes to public and get feedback from large community of developers.
  • 45. Why u no use git and github??
  • 46. Why u no use git and github??
  • 47. Commands Overview  git init Initializes a git repository. git status  Check your changes made (untracked files, modified files, staged files) git commit  Save your changes into one commit history. git push  Push your changes in the remote repository. git pull  Pull changes from remote repository and apply it to your local repository. git fetch  Fetch changes from remote repository but changes will not apply to your local repository      
  • 48. Git and Github  Git and github can be effectively used in project collaborations.  Can improve a developer’s coding.  Can avoid overriding or duplicating codes  Not just a developer tool
  • 49. “Whenever you are asked if you can do a job, tell'em, Certainly, I can! Then get busy and find out how to do it.” - Theodore Roosevelt