{"id":537,"date":"2017-02-13T17:10:54","date_gmt":"2017-02-13T17:10:54","guid":{"rendered":"https:\/\/barkhane.com\/php\/2017\/02\/13\/object-oriented-programming-system-php\/"},"modified":"2024-03-03T14:59:10","modified_gmt":"2024-03-03T14:59:10","slug":"object-oriented-programming-system-php","status":"publish","type":"post","link":"https:\/\/barkhane.com\/php\/object-oriented-programming-system-php\/","title":{"rendered":"Object Oriented Programming System in PHP"},"content":{"rendered":"<h2>Object Oriented Programming System\u00a0in PHP<\/h2>\n<p>Object Oriented Programming System\u00a0, or OOPS, refers to the method of programming that invokes the use of classes to organize the data and structure of an application.<\/p>\n<p>Main Parts of OOPS<\/p>\n<ul>\n<li><a href=\"https:\/\/barkhane.com\/php\/classes-in-php\/\">Classes<\/a><\/li>\n<li><a href=\"https:\/\/barkhane.com\/php\/object-in-php\/\">Object<\/a><\/li>\n<li><a href=\"https:\/\/barkhane.com\/php\/inheritance-php\/\">Inheritance<\/a><\/li>\n<li><a href=\"https:\/\/barkhane.com\/php\/polymorphism-in-php\/\">Polymorphism<\/a><\/li>\n<li><a href=\"https:\/\/barkhane.com\/php\/data-abstraction-in-php\/\">Data Abstraction<\/a><\/li>\n<li><a href=\"https:\/\/barkhane.com\/php\/encapsulation-in-php\/\">Encapsulation<\/a><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p>Important terms related to Object Oriented Programming.<\/p>\n<ul class=\"list\">\n<li><b>Class<\/b>\u00a0\u2212 This is a programmer-defined data type, which includes local functions as well as local data. You can think of a class as a template for making many instances of the same kind (or class) of object.<\/li>\n<li><b>Object<\/b>\u00a0\u2212 An individual instance of the data structure defined by a class. You define a class once and then make many objects that belong to it. Objects are also known as instance.<\/li>\n<li><b>Member Variable<\/b>\u00a0\u2212 These are the variables defined inside a class. This data will be invisible to the outside of the class and can be accessed via member functions. These variables are called attribute of the object once an object is created.<\/li>\n<li><b>Member function<\/b>\u00a0\u2212 These are the function defined inside a class and are used to access object data.<\/li>\n<li><b>Inheritance<\/b>\u00a0\u2212 When a class is defined by inheriting existing function of a parent class then it is called inheritance. Here child class will inherit all or few member functions and variables of a parent class.<\/li>\n<li><b>Parent class<\/b>\u00a0\u2212 A class that is inherited from by another class. This is also called a base class or super class.<\/li>\n<li><b>Child Class<\/b>\u00a0\u2212 A class that inherits from another class. This is also called a subclass or derived class.<\/li>\n<li><b>Polymorphism<\/b>\u00a0\u2212 This is an object oriented concept where same function can be used for different purposes. For example function name will remain same but it make take different number of arguments and can do different task.<\/li>\n<li><b>Overloading<\/b>\u00a0\u2212 a type of polymorphism in which some or all of operators have different implementations depending on the types of their arguments. Similarly functions can also be overloaded with different implementation.<\/li>\n<li><b>Data Abstraction<\/b>\u00a0\u2212 Any representation of data in which the implementation details are hidden (abstracted).<\/li>\n<li><b>Encapsulation<\/b>\u00a0\u2212 refers to a concept where we encapsulate all the data and member functions together to form an object.<\/li>\n<li><b>Constructor<\/b>\u00a0\u2212 refers to a special type of function which will be called automatically whenever there is an object formation from a class.<\/li>\n<li><b>Destructor<\/b>\u00a0\u2212 refers to a special type of function which will be called automatically whenever an object is deleted or goes out of scope.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Object Oriented Programming System\u00a0in PHP Object Oriented Programming System\u00a0, or OOPS, refers to the method of programming that invokes the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[3],"tags":[],"class_list":["post-537","post","type-post","status-publish","format-standard","hentry","category-php"],"_links":{"self":[{"href":"https:\/\/barkhane.com\/php\/wp-json\/wp\/v2\/posts\/537","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/barkhane.com\/php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/barkhane.com\/php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/barkhane.com\/php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/barkhane.com\/php\/wp-json\/wp\/v2\/comments?post=537"}],"version-history":[{"count":0,"href":"https:\/\/barkhane.com\/php\/wp-json\/wp\/v2\/posts\/537\/revisions"}],"wp:attachment":[{"href":"https:\/\/barkhane.com\/php\/wp-json\/wp\/v2\/media?parent=537"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/barkhane.com\/php\/wp-json\/wp\/v2\/categories?post=537"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/barkhane.com\/php\/wp-json\/wp\/v2\/tags?post=537"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}