PHP Interview Questions
Regarding OOPs
From Version Up IT Training -
https://versionup.in/
1
1.What Is PHP?
 PHP:Hypertext Preprocessor.
 PHP is a server side scripting language that
is embedded in HTML. It is used to manage
dynamic content, databases, session tracking,
even build entire e-commerce sites.
If You want to Learn PHP Contact On +91 8780656929
https://versionup.in/
2
Scripting
Javascript,PHP,
VB Script
Programming
Java,C,C++
Languages
If You want to Learn PHP Contact On +91 8780656929
https://versionup.in/
3
2.Why You Choose PHP?
 Open Source
High Performing
Flexible and Dynamic
Effective Frameworks And CMS
Large Community
If You want to Learn PHP Contact On +91 8780656929
https://versionup.in/
4
3. What's the latest version of php?
It’s 7.4.4 => 19 Mar 2020
If You want to Learn PHP Contact On +91 8780656929
https://versionup.in/
5
4. What are the major difference
between PHP 5 and PHP 7?
 Performance
 Declaring The Return Type
 Error Handling
 Spaceship Operator
 Anonymous Class
 New Operators
If You want to Learn PHP Contact On +91 8780656929
https://versionup.in/
6
5. Is PHP a strongly typed language?
No. PHP is a weakly typed or loosely typed
language
Sample code:
• $var = "Hello"; //String
• $var = 10; //Integer
If You want to Learn PHP Contact On +91 8780656929
https://versionup.in/
7
6.What is a class?
Collection Of Data member and member
Functions.
Example:
class Person{
public $name;
public $age;
}
If You want to Learn PHP Contact On +91 8780656929
https://versionup.in/
8
7. What is a Object?
Object is real time entity.
Object has some properties and behaviors.
$obj = new MyClass();
If You want to Learn PHP Contact On +91 8780656929
https://versionup.in/
9
8.What is Constructor and
Destructor?
Constructor:
Constructor is a special type of function
which will be called automatically
whenever there is any object created from
a class.
If You want to Learn PHP Contact On +91 8780656929
https://versionup.in/
10
If You want to Learn PHP Contact On +91 8780656929
https://versionup.in/
11
Destructor:
Destructor is a special type of function which
will be called automatically whenever any
object is deleted or goes out of scope.
9.What are access modifiers?
Public
Private
Protected
If You want to Learn PHP Contact On +91 8780656929
https://versionup.in/
12
10. What is Encapsulation?
Wrapping up member variables and methods
together into a single unit (i.e. Class) is called
Encapsulation.
If You want to Learn PHP Contact On +91 8780656929
https://versionup.in/
13
11. What is Abstraction?
Abstraction is a concept in which
implementation details are hidden..
If You want to Learn PHP Contact On +91 8780656929
https://versionup.in/
14
12.Explain about polymorphism?
One thing, can use in different forms
1)Function Overloading
2)Function Overriding
If You want to Learn PHP Contact On +91 8780656929
https://versionup.in/
15
12.Explain about polymorphism?
One thing, can use in different forms
1)Function Overloading
2)Function Overriding
If You want to Learn PHP Contact On +91 8780656929
https://versionup.in/
16
13. Magic Methods in PHP
Construct
Destruct
Clone
Call
Autoload
If You want to Learn PHP Contact On +91 8780656929
https://versionup.in/
17
14.Difference Between Interfaces &
Abstract Class
Interface:
An interface is an agreement or a contract.
When a class implements an interface, It
means it contains same public methods of an
interface with their implementation.
If You want to Learn PHP Contact On +91 8780656929
https://versionup.in/
18
If You want to Learn PHP Contact On +91 8780656929
https://versionup.in/
19
Abstract class Interface
In abstract class a method must be
declared as abstract. Abstract methods
doesn’t have any implementation.
In interface all the methods by default are
abstract.
Abstract class can also contain member
variables and concrete
functions/methods.
Interfaces cannot contain any member
variables and concrete functions/methods
except constants.
An Abstract methods can be declare
with access modifiers like public,
protected etc. Concrete Class which is
extending the abstract class must be
defined with the same or visibility.
All methods declared in an interface must
be public.
A class can Inherits only one Abstract
class and Multiple inheritance is not
possible for Abstract class.
A class can implements many interfaces
and Multiple interface inheritance is
possible.
Only complete member of abstract class
can be static.
Memebrs of Interface can not be static.
15.What is STATIC keyword and what
is it's use in PHP ?
static member
static Function
If You want to Learn PHP Contact On +91 8780656929
https://versionup.in/
20
16.What is Traits in PHP?
Traits are a mechanism for code reuse in single
inheritance languages such as PHP.
If You want to Learn PHP Contact On +91 8780656929
https://versionup.in/
21
17. What are the advantages of
object oriented programming?
Code Resusability
Modularity
Flexibility
Maintainability
Security
Testability
If You want to Learn PHP Contact On +91 8780656929
https://versionup.in/
22
About Us
We Are Proving Professional It Training. If you
Want to learn Any New Technology you can
contact us on :
Contact On :
https://versionup.in/
Call On :+91 8780656929
If You want to Learn PHP Contact On +91 8780656929
https://versionup.in/
23

More Related Content

DOCX
Interface in java
PDF
FNT Software Solutions Pvt Ltd Placement Papers - PHP Technologies
PPTX
Lecture 18
PPTX
Php training in chandigarh
PDF
Boston Startup School - OO Design
DOCX
Mca1020 programming in c
PPTX
Code generation
PPTX
C# Interface | Interfaces In C# | C# Interfaces Explained | C# Tutorial For B...
Interface in java
FNT Software Solutions Pvt Ltd Placement Papers - PHP Technologies
Lecture 18
Php training in chandigarh
Boston Startup School - OO Design
Mca1020 programming in c
Code generation
C# Interface | Interfaces In C# | C# Interfaces Explained | C# Tutorial For B...

Similar to Php OOP interview questions (20)

PDF
PHP Basics
PPTX
PHP Fundamentals: A Comprehensive Introduction
DOCX
Report.docx
PPTX
Object oreinted php | OOPs
ODP
A Good PHP Framework For Beginners Like Me!
DOCX
php questions
PDF
chapter 5 Server-Side Scripting (PHP).pdf
PDF
Workshop: Refactoring Legacy PHP: The Complete Guide
PPTX
OOFeatures_revised-2.pptx
PPTX
PHP Interview Questions for Freshers 2018
ODP
The PHP mysqlnd plugin talk - plugins an alternative to MySQL Proxy
PPT
GTU MCA PHP Interview Questions And Answers for freshers
PDF
C#.net interview questions for dynamics 365 ce crm developers
PPTX
Constructor and encapsulation in php
ODP
The power of mysqlnd plugins
PPTX
Object-oriented programming 3.pptx
PPTX
Software Development with PHP & Laravel
PPTX
Introduction to PHP OOP
PPTX
Fundamentals of programming final
DOCX
Guidelines php 8 gig
PHP Basics
PHP Fundamentals: A Comprehensive Introduction
Report.docx
Object oreinted php | OOPs
A Good PHP Framework For Beginners Like Me!
php questions
chapter 5 Server-Side Scripting (PHP).pdf
Workshop: Refactoring Legacy PHP: The Complete Guide
OOFeatures_revised-2.pptx
PHP Interview Questions for Freshers 2018
The PHP mysqlnd plugin talk - plugins an alternative to MySQL Proxy
GTU MCA PHP Interview Questions And Answers for freshers
C#.net interview questions for dynamics 365 ce crm developers
Constructor and encapsulation in php
The power of mysqlnd plugins
Object-oriented programming 3.pptx
Software Development with PHP & Laravel
Introduction to PHP OOP
Fundamentals of programming final
Guidelines php 8 gig
Ad

Recently uploaded (20)

PDF
Mucosal Drug Delivery system_NDDS_BPHARMACY__SEM VII_PCI.pdf
PDF
Vision Prelims GS PYQ Analysis 2011-2022 www.upscpdf.com.pdf
PDF
Uderstanding digital marketing and marketing stratergie for engaging the digi...
PDF
LIFE & LIVING TRILOGY - PART - (2) THE PURPOSE OF LIFE.pdf
PPTX
What’s under the hood: Parsing standardized learning content for AI
PDF
BP 704 T. NOVEL DRUG DELIVERY SYSTEMS (UNIT 1)
DOCX
Cambridge-Practice-Tests-for-IELTS-12.docx
PDF
Race Reva University – Shaping Future Leaders in Artificial Intelligence
PDF
1.3 FINAL REVISED K-10 PE and Health CG 2023 Grades 4-10 (1).pdf
PDF
Paper A Mock Exam 9_ Attempt review.pdf.
PDF
Environmental Education MCQ BD2EE - Share Source.pdf
PPTX
Education and Perspectives of Education.pptx
PDF
My India Quiz Book_20210205121199924.pdf
PPTX
B.Sc. DS Unit 2 Software Engineering.pptx
PPTX
Module on health assessment of CHN. pptx
PDF
BP 505 T. PHARMACEUTICAL JURISPRUDENCE (UNIT 2).pdf
PDF
advance database management system book.pdf
PDF
BP 505 T. PHARMACEUTICAL JURISPRUDENCE (UNIT 1).pdf
PDF
What if we spent less time fighting change, and more time building what’s rig...
PDF
David L Page_DCI Research Study Journey_how Methodology can inform one's prac...
Mucosal Drug Delivery system_NDDS_BPHARMACY__SEM VII_PCI.pdf
Vision Prelims GS PYQ Analysis 2011-2022 www.upscpdf.com.pdf
Uderstanding digital marketing and marketing stratergie for engaging the digi...
LIFE & LIVING TRILOGY - PART - (2) THE PURPOSE OF LIFE.pdf
What’s under the hood: Parsing standardized learning content for AI
BP 704 T. NOVEL DRUG DELIVERY SYSTEMS (UNIT 1)
Cambridge-Practice-Tests-for-IELTS-12.docx
Race Reva University – Shaping Future Leaders in Artificial Intelligence
1.3 FINAL REVISED K-10 PE and Health CG 2023 Grades 4-10 (1).pdf
Paper A Mock Exam 9_ Attempt review.pdf.
Environmental Education MCQ BD2EE - Share Source.pdf
Education and Perspectives of Education.pptx
My India Quiz Book_20210205121199924.pdf
B.Sc. DS Unit 2 Software Engineering.pptx
Module on health assessment of CHN. pptx
BP 505 T. PHARMACEUTICAL JURISPRUDENCE (UNIT 2).pdf
advance database management system book.pdf
BP 505 T. PHARMACEUTICAL JURISPRUDENCE (UNIT 1).pdf
What if we spent less time fighting change, and more time building what’s rig...
David L Page_DCI Research Study Journey_how Methodology can inform one's prac...
Ad

Php OOP interview questions

  • 1. PHP Interview Questions Regarding OOPs From Version Up IT Training - https://versionup.in/ 1
  • 2. 1.What Is PHP?  PHP:Hypertext Preprocessor.  PHP is a server side scripting language that is embedded in HTML. It is used to manage dynamic content, databases, session tracking, even build entire e-commerce sites. If You want to Learn PHP Contact On +91 8780656929 https://versionup.in/ 2
  • 3. Scripting Javascript,PHP, VB Script Programming Java,C,C++ Languages If You want to Learn PHP Contact On +91 8780656929 https://versionup.in/ 3
  • 4. 2.Why You Choose PHP?  Open Source High Performing Flexible and Dynamic Effective Frameworks And CMS Large Community If You want to Learn PHP Contact On +91 8780656929 https://versionup.in/ 4
  • 5. 3. What's the latest version of php? It’s 7.4.4 => 19 Mar 2020 If You want to Learn PHP Contact On +91 8780656929 https://versionup.in/ 5
  • 6. 4. What are the major difference between PHP 5 and PHP 7?  Performance  Declaring The Return Type  Error Handling  Spaceship Operator  Anonymous Class  New Operators If You want to Learn PHP Contact On +91 8780656929 https://versionup.in/ 6
  • 7. 5. Is PHP a strongly typed language? No. PHP is a weakly typed or loosely typed language Sample code: • $var = "Hello"; //String • $var = 10; //Integer If You want to Learn PHP Contact On +91 8780656929 https://versionup.in/ 7
  • 8. 6.What is a class? Collection Of Data member and member Functions. Example: class Person{ public $name; public $age; } If You want to Learn PHP Contact On +91 8780656929 https://versionup.in/ 8
  • 9. 7. What is a Object? Object is real time entity. Object has some properties and behaviors. $obj = new MyClass(); If You want to Learn PHP Contact On +91 8780656929 https://versionup.in/ 9
  • 10. 8.What is Constructor and Destructor? Constructor: Constructor is a special type of function which will be called automatically whenever there is any object created from a class. If You want to Learn PHP Contact On +91 8780656929 https://versionup.in/ 10
  • 11. If You want to Learn PHP Contact On +91 8780656929 https://versionup.in/ 11 Destructor: Destructor is a special type of function which will be called automatically whenever any object is deleted or goes out of scope.
  • 12. 9.What are access modifiers? Public Private Protected If You want to Learn PHP Contact On +91 8780656929 https://versionup.in/ 12
  • 13. 10. What is Encapsulation? Wrapping up member variables and methods together into a single unit (i.e. Class) is called Encapsulation. If You want to Learn PHP Contact On +91 8780656929 https://versionup.in/ 13
  • 14. 11. What is Abstraction? Abstraction is a concept in which implementation details are hidden.. If You want to Learn PHP Contact On +91 8780656929 https://versionup.in/ 14
  • 15. 12.Explain about polymorphism? One thing, can use in different forms 1)Function Overloading 2)Function Overriding If You want to Learn PHP Contact On +91 8780656929 https://versionup.in/ 15
  • 16. 12.Explain about polymorphism? One thing, can use in different forms 1)Function Overloading 2)Function Overriding If You want to Learn PHP Contact On +91 8780656929 https://versionup.in/ 16
  • 17. 13. Magic Methods in PHP Construct Destruct Clone Call Autoload If You want to Learn PHP Contact On +91 8780656929 https://versionup.in/ 17
  • 18. 14.Difference Between Interfaces & Abstract Class Interface: An interface is an agreement or a contract. When a class implements an interface, It means it contains same public methods of an interface with their implementation. If You want to Learn PHP Contact On +91 8780656929 https://versionup.in/ 18
  • 19. If You want to Learn PHP Contact On +91 8780656929 https://versionup.in/ 19 Abstract class Interface In abstract class a method must be declared as abstract. Abstract methods doesn’t have any implementation. In interface all the methods by default are abstract. Abstract class can also contain member variables and concrete functions/methods. Interfaces cannot contain any member variables and concrete functions/methods except constants. An Abstract methods can be declare with access modifiers like public, protected etc. Concrete Class which is extending the abstract class must be defined with the same or visibility. All methods declared in an interface must be public. A class can Inherits only one Abstract class and Multiple inheritance is not possible for Abstract class. A class can implements many interfaces and Multiple interface inheritance is possible. Only complete member of abstract class can be static. Memebrs of Interface can not be static.
  • 20. 15.What is STATIC keyword and what is it's use in PHP ? static member static Function If You want to Learn PHP Contact On +91 8780656929 https://versionup.in/ 20
  • 21. 16.What is Traits in PHP? Traits are a mechanism for code reuse in single inheritance languages such as PHP. If You want to Learn PHP Contact On +91 8780656929 https://versionup.in/ 21
  • 22. 17. What are the advantages of object oriented programming? Code Resusability Modularity Flexibility Maintainability Security Testability If You want to Learn PHP Contact On +91 8780656929 https://versionup.in/ 22
  • 23. About Us We Are Proving Professional It Training. If you Want to learn Any New Technology you can contact us on : Contact On : https://versionup.in/ Call On :+91 8780656929 If You want to Learn PHP Contact On +91 8780656929 https://versionup.in/ 23