[0:00] well hello Internet and welcome to my [0:01] tutorial on objectoriented PHP in this [0:04] tutorial I'm basically going to cover [0:05] everything you ever want to know about [0:06] objectoriented side of PHP and I have a [0:09] lot to do so let's get into it okay so [0:13] what I'm going to be using in this [0:14] tutorial is kodo uh you can use a basic [0:17] text editor but I just decided to use [0:18] this because it's free and just to give [0:20] you another idea what you can develop [0:22] PHP with and you can find it at kodo [0:25] id.com download slum sign edit and I [0:29] also have it in the description now [0:30] before we start I thought I would very [0:32] quickly cover exactly or at least [0:35] roughly what object-oriented programming [0:37] means now if we have a basic class man [0:40] what that's going to mean is all men [0:42] have attributes like the man you'd see [0:44] here he might have black hair is H might [0:46] be Bob he might have an array of ties [0:48] shirts pants and shoes and we also all [0:52] have abilities or functions or [0:55] operations that we can perform like [0:57] every man can talk walk run throw eat [0:59] and and work now objectoriented [1:01] programming allows us to model Real [1:04] World objects inside of things called [1:06] classes they are the blueprints for [1:08] creating objects and inside of those [1:10] classes we're going to define the [1:12] attributes and the functions or methods [1:16] that those objects can do and that is [1:17] the basics of what it means to be a [1:20] class and what a class does and what an [1:21] object is we model Real World objects in [1:24] object-oriented programming that's why [1:25] it's so awesome so what is inheritance [1:27] well let's say we have an object that is [1:30] called man and we want to create a more [1:32] specific version of a man called Mark [1:35] well what we're going to do is Mark is [1:37] going to inherit all the attributes and [1:40] functions that are in the man class and [1:43] then we can build or change those [1:44] attributes and functions in the mark [1:47] class and that is basically what [1:49] inherence is and overriding just means [1:51] that we would go in and say override a [1:54] function so that a function doesn't do [1:56] what it previously had done now when I [1:58] refer to function they are also referred [2:01] to as methods and operations but they [2:03] are basically functions some people [2:05] might disagree with me saying that but [2:07] either way just to keep this basic you [2:08] can think of methods functions and [2:10] operations as being all the same things [2:13] so what is polymorphism aside from being [2:14] a big word well like we just saw there [2:17] mark inherited all the attributes and [2:20] all of the functions or methods from the [2:22] man class whenever he created the mark [2:25] class now if he goes into the walk [2:28] method and instead of just printing out [2:30] walk he instead says he wants to print [2:33] out walk fast whenever Java sees that it [2:36] is getting a man object that is trying [2:39] to walk it is going to print out walk to [2:42] the screen and whenever it sees the mark [2:45] class it's going to say oh you inherited [2:48] the walk method from the man class we're [2:51] going to go in and make certain that you [2:53] didn't change the walk method in any way [2:56] jav is going to see that we instead want [2:58] to walk fast with the mark object and [3:00] hence it's automatically going to print [3:02] that out now polymorphism can get a lot [3:04] more complicated from there but that is [3:06] just a basic gist or something just to [3:08] understand and you'll understand a lot [3:09] of how polymorphism works and that [3:11] brings us to interfaces what is an [3:13] interface well basically when our class [3:17] Mark decides that it wants to implement [3:20] an interface what it's in essence doing [3:22] is signing a contract that says I the [3:24] mark class promise to implement any [3:27] methods or functions that are in the [3:29] interface and I'm going to show you [3:31] examples of all these different things [3:33] right now okay so this time I have [3:35] Komodo on the left and I have Google [3:37] Chrome on the right and I have my server [3:40] set up in Local Host and I'm just going [3:41] to execute things first thing I'm going [3:43] to do is command and create a class well [3:45] all you do is type in class and in this [3:47] situation I'm going to type animal and [3:50] that is going to be it I'm going to make [3:51] some changes to it later of course and [3:53] then inside of this what I'm going to do [3:55] is I'm going to define the attributes [3:56] that I want my animal to have well the [3:58] very first I'm going to do is I'm going [4:00] to type protected in here and there are [4:03] different ways to categorize both [4:05] methods as well as attributes you can [4:08] have protected you can have public and [4:11] you can have private now private means [4:14] that only methods or functions in the [4:16] class can access and change this data [4:19] public means that any code can directly [4:22] access and change the values for these [4:24] attributes and protected is just like [4:27] private meaning that only method in the [4:30] class can access and change this data [4:32] however when we create a subass like we [4:34] did Mark from the man the subass is [4:38] going to still be able to change the [4:40] value for this attribute so I want the [4:44] protection of private but I also want [4:45] sub classes to be able to inherit all [4:48] this data so if it was Private couldn't [4:50] do that just stick around here you'll [4:51] get it so I'm going to create a couple [4:53] protected attributes and let's say that [4:56] all our animals are going to have names [4:58] and all I'm doing here is to defining [5:00] the attributes we have and let's also [5:02] say that each of these animals is going [5:04] to have a favorite food not favorite [5:07] name favorite food protected again [5:09] they're all going to make a specific [5:11] sound and they are all going to have a [5:14] specific ID number this brings us on to [5:17] the next thing I want to talk about [5:18] which are static attributes and this [5:20] time I'm going to make this public so [5:22] anybody can access this and let's say [5:25] that every time I create a new animal [5:27] object I want to automatically increment [5:30] the number of animals it's going to [5:32] start off at zero because we haven't [5:33] made any animals yet and what static [5:36] ultimately means is that every object of [5:39] the type animal that is ever created [5:41] they are all going to share number of [5:44] animals so if this number goes up to one [5:46] it's going to go up to one for every [5:49] other animal object that is created and [5:51] if you ever want to access a static [5:55] value and make a change to it I'm going [5:56] to show you how to do this later you're [5:58] just going to type in the class name [5:59] with two colons and then number of [6:02] animals and then you could go and add [6:04] one to this or do whatever I'm going to [6:06] actually show you this in an example in [6:08] a second another thing we can have [6:09] inside of here are constants and there's [6:12] a constant and let's just say I want to [6:13] put Pi in here for some Bizarro reason [6:15] so I'm just going to put in [6:18] 3.14159 and there we go and a constant [6:21] just means that it's going to be [6:22] constant and it's never going to change [6:23] its value if you want to refer to that [6:25] once again you're going to type in the [6:27] animal class name or the class last name [6:30] two colons and then Pi in this situation [6:32] and that's going to get you access to [6:34] that and once again I'm going to show [6:35] you that in a second now you're going to [6:37] Define functions inside of classes just [6:40] like you define functions in anything so [6:43] let's say I want to create a function [6:44] that is going to return the name this is [6:47] a situation in which we have something [6:48] called encapsulation not that [6:50] complicated remember when we talked [6:52] about private and protected and public [6:54] well by marking these as protected or [6:57] private we are encapsulating or protect [6:59] ing that data we are saying that we [7:01] don't want anybody to come in here and [7:03] willy-nilly be able to change the data [7:05] what we're going to say instead is if [7:07] they want to get the name for my animal [7:10] they're going to have to call the get [7:12] name function and when they do we're [7:14] going to return it and we encapsulate or [7:17] protect data so that they can not go in [7:20] there and do things like change the name [7:22] of my animal to a number or something [7:25] nonsensical okay just to protect the [7:27] data and as you can see right here if if [7:29] we want to refer to an attribute inside [7:32] of a class what we do is we type in this [7:35] meaning this specific object and we want [7:39] the name that is stored for that [7:42] specific object this is basically used [7:44] as a generic way to say that we want the [7:47] name for whatever the current object we [7:49] are using because it's not going to be [7:50] able to address the object by name so we [7:53] just use this now another functions that [7:56] is very useful is called a Constructor [7:59] and to create that we just type in [8:02] construct with two underscores in front [8:04] of it and then what this guy is going to [8:06] do is initialize things or set some [8:09] values whenever we create every animal [8:11] well what do you think would be a good [8:13] value to change well we're going to need [8:15] an ID for our animal that's going to be [8:17] random and unique and we're going to [8:19] have to increment the number of animals [8:20] when we create a new animal object so if [8:23] we want to create ourselves a new ID we [8:25] want to refer to our ID for our animal [8:28] object that we created we just go this [8:31] again with that little arrow and then we [8:33] go Rand and then if we want to generate [8:35] a random number let's say between 100 [8:37] and 1 million we would just do that and [8:40] there we go so now each animal that we [8:42] create is going to sort of have a random [8:44] number and let's say that we want to [8:46] Echo out to the screen the ID this like [8:49] that ID and then we'll put some text in [8:51] here has been assigned and then we'll [8:53] throw a break statement in there at the [8:55] end with a semicolon of course and now [8:56] I'm going to show you how to access the [8:58] static attribute that I talked about [9:00] before we're just going to type in [9:01] animal two colons and then we're going [9:03] to type in number of animals and we are [9:05] going to increment it because we created [9:07] a new animal object another thing we [9:09] have available to us is what's called a [9:12] Destructor and let's just put public in [9:14] front of that and two underscores and [9:17] destruct now the destructor is going to [9:19] be called when all references to an [9:21] object have been unset so if there's [9:23] some housekeeping you want to do [9:25] whenever an object is deleted you could [9:27] do so in this situation what I'm going [9:29] to do is I'm just going to print out to [9:30] the screen that the object has been [9:32] deleted is being destroyed of course you [9:35] would never use this but in your uh [9:37] website but whatever put a little frowny [9:40] face there and there we go now remember [9:41] up here where we were creating the git [9:44] name function so that we could get the [9:46] value of name for our different [9:48] functions well PHP actually provides a [9:51] shortcut way to be able to create what [9:53] are called Getters and Setters Getters [9:55] are going to get you the value of these [9:56] attributes and Setters are going to set [9:58] the values and because they're protected [10:00] that means we need to use a function to [10:02] change these values and get these [10:04] attributes and these little handy dandy [10:06] things are called Magic Setters and [10:08] Getters and these are actually magic [10:10] methods as well anything with an [10:12] underscore is a magic method so if we [10:14] want to define a function inside of this [10:17] guy that is going to be able to get [10:19] anything we're going to type in function [10:21] and then we're going to type in get and [10:23] we're going to pass the name of the [10:26] attribute that we want to get to this [10:28] function whenever ever it's called and [10:30] if we want to print something out to the [10:31] screen just to show that something's [10:32] going on here we could do something like [10:34] asked for name which is going to be the [10:37] attribute they're asking for and a break [10:39] statement again and then if we want to [10:41] return it the attribute we can just come [10:43] in here and go this and the name that [10:46] was passed inside of here so we're going [10:47] to have to put a dollar sign and name [10:49] because it would get confused otherwise [10:51] it would think this was the name we're [10:52] looking for this is going to return [10:54] whatever attribute is passed in here and [10:55] I'm going to show you examples of all [10:57] these here in a second now if we want to [10:58] set the value this time I'm going to do [11:00] something a little bit more complicated [11:01] just to do something a little bit more [11:03] complicated I'm going to check that the [11:05] attribute that they sent in here was [11:07] actually a valid attribute now with this [11:09] you're going to pass in the attribute [11:10] name and the new value that you want to [11:13] set for set attribute and let's say I [11:15] want to check that the name they passed [11:17] in is actually a valid attribute one [11:19] thing I could do is use a switch [11:20] statement here and then I can come in [11:21] here and go case and I'm just like I [11:23] said I'm just doing this to show you how [11:25] to do it and then we could come in here [11:27] and say if it's name well we know name [11:28] exists this so set name to whatever the [11:32] value is and then we can do pretty much [11:34] the same thing well we're going to throw [11:35] in a break statement also there we go [11:37] and we could do the same thing with [11:39] favorite food do the same thing with [11:41] sound once to set the sound for my [11:44] animal and then finally if it's none of [11:46] those attributes what I'm going to say [11:48] is I'm just going to Echo out to the [11:49] screen name not found and then after all [11:52] that's done I get out of my switch [11:54] statement I could come down here and [11:56] just to print something out on the [11:57] screen I could print out set name name [11:59] to Value so there that is and that is [12:02] how the little magic methods for setting [12:04] and getting are used and like I said [12:06] before inheritance occurs whenever you [12:09] create a new class by extending another [12:11] one and like I said we're going to [12:13] inherit all the attributes and methods [12:15] that are defined in the super class [12:17] animal in this situation is a super [12:19] class inside of the subass so what we're [12:22] going to do is we're going to create a [12:24] new class and it's going to be called [12:26] dog and if we want to inherit everything [12:28] from animal we're going to type in [12:30] extends and then animal and later on [12:32] I'll cover interfaces now let's jump up [12:34] here and let's create a function that we [12:37] are just going to override so we'll [12:39] create a function called run inside of [12:42] our animal class we're in the animal [12:43] class right now and let's say this one [12:45] goes Echo this name runs we'll throw a [12:49] braak statement in there and then we'll [12:50] actually just copy this cuz we're going [12:52] to override it and as you can tell I [12:54] don't need to put the attributes inside [12:55] a dog that are an animal they're [12:57] automatically there so name is inside of [12:59] this and let's say that our dogs run [13:01] like crazy and that's how you override a [13:04] method so now what I'm going to do is [13:05] I'm going to jump outside of the dog and [13:07] animal class and start creating them and [13:10] you can watch everything sort of execute [13:12] here over inside of chrome so I'm [13:14] outside of both of the classes and if I [13:16] want to define a new animal I just go [13:18] animal and let's say I want to say [13:20] animal one is equal to new animal and [13:23] there we go and the Constructor this guy [13:25] right here is going to be called [13:27] whenever I create this new new animal [13:30] and I could also pass in attributes for [13:32] the Constructor but I decided not to do [13:34] that now what I'm going to do is come in [13:36] and set the attributes for my new animal [13:38] object I created and I'm just going to [13:40] type in name and I'm going to give it [13:42] the name of spot and then I'm also going [13:45] to set favorite food equal to meat and [13:48] then I'm going to set the sound that my [13:51] animal makes to rough now if I want to [13:53] print out all this new data onto our [13:55] screen I could do something like Echo [13:57] animal one name [13:59] says and then call the sound for my [14:02] animal and then go down to the next line [14:05] and we'll say something like give me [14:07] some and then let's say favorite food [14:09] and then let's say we also want to print [14:11] out the ID number here my ID is put [14:14] another period and all the code is of [14:16] course available in a link in the [14:18] description and then if I want to print [14:19] out the ID I just go ID and then if I [14:21] also want to print out the total animals [14:24] that have been created go total animals [14:26] is equal to and then if I want to call [14:28] that stack IC value number of animals [14:31] remember I just type in the class Name [14:32] colon colon number of animals put [14:34] another period inside of there throw two [14:36] break statements in there and there we [14:38] go now I can go over inside of chrome [14:40] and execute this and you're going to see [14:42] that the ID number has been assigned the [14:44] name of spot has been assigned Favorite [14:47] Foods meat sound is rough I called the [14:49] getter to get the name the sound and the [14:52] favorite food and then it printed out [14:53] all of that information on the screen [14:55] and then you can also see here that spot [14:57] was destroyed after the object was no [14:58] longer longer needed this is the [15:00] destructor function right there if I [15:02] wanted to come in here and also print [15:03] out the favorite number just to show you [15:05] how to print a constant from a class [15:07] favorite number again just type in the [15:10] class name and piie and we'll throw in a [15:12] break statement and there you can see [15:14] favorite number printed out as well now [15:15] I'm going to do exactly the same thing [15:17] except I'm going to use the dog class so [15:20] I'm going to come in here and just copy [15:21] all this because there's not much I need [15:22] to change paste that in there and I'm [15:24] going change this to animal 2 and it's [15:27] going to be of type dog change that that [15:29] to two change that to two change that to [15:31] two two two two two and I can change [15:35] this to dog and it's still going to be [15:37] able to get it and then I'm just going [15:38] to come in here and change the [15:39] attributes I'm going to change this to [15:41] Grover I'm going to change this to [15:43] mushrooms just to be weird and I'm going [15:45] to change this to G save it over here [15:49] execute and there you can see we created [15:51] a new ID number the name is set to [15:53] Grover all those things are working [15:55] Grover says G give me some mushrooms my [15:57] ID is blah blah blah blah blah one thing [15:59] you might find weird here is animals [16:02] shows up as two there are still two [16:04] animals created and even though we are [16:06] referring to a dog in this situation it [16:09] is still going to increment the numbers [16:11] because it ultimately calls the [16:12] Constructor inside of the animal class [16:15] now the next thing to talk about here is [16:17] we went in here and we overrode the Run [16:20] class so here we have runs for our [16:22] animal class and here we have runs like [16:25] crazy for a dogs class so I'm going to [16:27] show you exactly how that works Works [16:29] come in here and just go animal one and [16:31] if we want to run a method inside of [16:33] here we just type in whatever the [16:35] object's name is and then whatever we [16:37] want to run and animal two in this [16:39] situation and run and when we execute [16:42] you're going to see spot runs and Grover [16:44] runs like crazy and you can also see [16:46] here Grover is destroyed spot is [16:48] destroyed now what would happen if we [16:49] want to actually come into our animal [16:51] class and Define a function that we [16:53] don't want to allow the subclasses to [16:56] override well we're in the animal class [16:58] right now it's actually quite easy we [17:00] just type in final and then if they try [17:02] to override it in the dog class well [17:04] it's just going to throw up a whole [17:05] bunch of errors it's not going to allow [17:07] it to happen so let's say we create a [17:08] function called what is good and all it [17:11] says is running is good and once again [17:13] if we wanted to execute this we would [17:15] have to come in here and just say what [17:17] is good again we're going to use the [17:19] same whatever the object's name is well [17:21] we could just do this what is good and [17:24] you can see running as good as right [17:25] there so even though it's just an animal [17:27] of course it's going to run inside of [17:29] the dog class CU it inherited that [17:32] another thing we could do is you see [17:33] here where we're printing out all this [17:35] information well let's say we wanted [17:37] this information to automatically be [17:38] printed out anytime the user said Echo [17:41] and Then followed by the name of our [17:43] object well we could do that what we're [17:45] going to do is we're just going to come [17:46] in here and copy this and then we're [17:48] going to go up into our animal class we [17:50] going go right here and we're going to [17:51] use another magic method and this one's [17:53] going to be called two string and all [17:55] two string does is it defines inside of [17:58] here what happened happens whenever the [17:59] user says I want to print some [18:02] information out on the screen whenever [18:04] somebody goes Echo and follows that up [18:06] with the name of the object all you're [18:07] going to do is type in return and then [18:09] you're going to print out what you want [18:10] to show up except you're going to want [18:12] to change all of these specific object [18:14] names to this so just change these to [18:16] this this this and then here we're going [18:19] to change this to animal of course and [18:21] everything else can stay the same and [18:22] then you could do something like go Echo [18:25] animal one just type in the object's [18:27] name save it execute there you can see [18:29] it printed out on the screen right there [18:31] now remember when I talked about [18:32] interfaces and interfaces are just a [18:34] contract that says that any class that [18:36] implements an interface must Define the [18:38] functions that are inside of the [18:40] interface and this is a way for us to [18:42] take advantage of polymorphism so we're [18:44] going to do here is Define an interface [18:46] by going in typing interface and let's [18:49] say we want to say singable we want to [18:51] give our animals the ability to sing and [18:54] we're going to come in here and Define [18:56] the function but we don't say what the [18:58] function does we just leave it like that [19:01] and what that means is when we go into [19:03] say our dog class and say implements and [19:06] then singable that it is going to force [19:08] us to Define sing inside of it so we're [19:11] going to say function sing and if you [19:14] don't Define anything a function is [19:16] automatically public and then we're [19:17] going to say Echo this name sings and [19:20] then we'll do something like g g g g [19:24] semicolon at the end and then we're [19:26] going to do exactly the same thing with [19:28] our animal CL class so come up here and [19:30] the great thing about using interfaces [19:33] is you can only ever extend one object [19:37] but you can Implement a NeverEnding [19:39] array of interfaces so that's why they [19:40] are very useful so singable it's going [19:43] to say we have to create the sing class [19:45] inside here or the sing method there we [19:47] go and there we are and then just Bow [19:50] Wow Wow and then if we come down here [19:52] and go animal one or animal 2 or [19:55] whatever and call sing it is going to [19:56] print that out on our screen so there's [19:58] an example using an interface another [20:00] example of polymorphism is here where [20:03] we're going to be able to Define [20:04] functions that are going to be able to [20:06] accept classes that extend a specific [20:09] class or a specific interface here's [20:11] polymorphism in action again so this is [20:14] outside of any of the classes we're [20:15] going to come in here and we're going to [20:16] type in function and we could say [20:18] something like make them sing and then [20:21] we could say singable because both the [20:23] animal and the dog objects are both of [20:26] type singable and we could just type in [20:28] singing animal here and then we could [20:30] just type in singing animal and call [20:32] sing and it's automatically going to [20:34] execute the right sing in the right [20:36] animal even though it doesn't say here [20:38] that it's of animal type or of dog type [20:41] it says it's of singable type so we'll [20:42] be able to just come in here and go make [20:44] them sing and pass in animal one or [20:47] animal 2 and when we execute it's going [20:50] to automatically have the right animal [20:52] sing see there you go and of course [20:54] since you can do this with the different [20:56] classes that implement the different [20:58] interface of course you're also going to [20:59] be able to do it with the dog class [21:01] because it extends the animal class so [21:04] here what we're going to do is go [21:05] function sing animal and you can see [21:07] there it's animal type singing animal [21:09] once again this is outside of any of the [21:11] classes and I'm just going to copy this [21:13] up here so I don't have to type it out [21:14] again and once again I'm going to be [21:15] able to go sing animal sing animal and [21:18] then let's just copy these there you go [21:20] execute and you can see it prints out [21:22] the right things even though all I said [21:24] here was that I was passing animal [21:26] objects okay polymorph is in action [21:29] another type of function you're going to [21:31] have inside of PHP is what are called [21:33] Static functions now static functions or [21:35] methods can be called without the need [21:38] to instantiate or create an object [21:41] sounds like a big word but they're not [21:42] really that's what it means when [21:44] somebody says instantiate that means [21:45] they just created an object let's just [21:47] go into the animal class again and I'm [21:50] going to type in static meaning this [21:52] belongs to the class add these and let's [21:55] say that I wanted to accept a number one [21:58] and a number two as like a utility [22:00] function that doesn't really make sense [22:02] that my animals will be able to add but [22:04] I wanted to have this in here for some [22:05] Bizarro reason this is terrible form by [22:07] the way but I'm just doing this just to [22:09] show you what a static function is [22:11] number one plus number two throw a break [22:14] statement in there and now what I can do [22:15] is come down inside of here and do [22:17] something like Echo 3 + 5 is equal to [22:22] and if I want to call that static [22:23] function I just go animal which is where [22:25] it resides and then I call add these and [22:27] then let's say I pass in three and five [22:30] and then if I execute it you're going to [22:32] see 3 + 5 is equal 8 that's a static [22:34] function and now I'll run through a [22:36] bunch of other different things you can [22:37] do with PHP you can check the class type [22:40] so let's say something like is it an [22:43] animal we want to check if it's an [22:45] animal you would go and put something [22:47] like animal to and then instance of and [22:50] then it'll say animal and yes indeed [22:52] animal 2 even though it's a dog object [22:54] is an instance of the animal object type [22:57] and then we'll say that we want to [22:58] assign true if it is or false if it [23:01] isn't and you could go in here and put [23:03] other different things inside of here [23:05] and check the class type on your own [23:07] Echo do something like it is that animal [23:12] I'm using single quotes here so I can [23:13] actually type in animal 2 in this [23:15] situation with the dollar sign is an [23:18] animal break statement it is true that [23:21] animal 2 is an animal see print it right [23:23] there another thing we could do is clone [23:25] which is make a clone of an object and [23:28] you could actually inside of your class [23:31] Define the things that you want to be [23:33] copied over to any clones and you would [23:35] just create a function inside of it with [23:37] the magic two underscores with clone [23:39] after it and then that would be called [23:41] anytime something was cloned but just to [23:43] keep this nice and short I'm just going [23:45] to show you how to create a clone so [23:47] let's go animal clone is equal to and [23:49] then you would just type clone and then [23:51] you'd go animal one now we just create a [23:54] copy of it another thing you can do is [23:56] Define what are called abstract classes [23:58] and and also abstract methods now an [24:00] abstract class cannot be instantiated it [24:03] cannot have an object be created of type [24:06] whatever the abstract class is but [24:08] instead it forces classes that implement [24:11] it to override every abstract method [24:14] that exists inside of it you want to [24:16] create an abstract class you just type [24:18] in abstract class and then whatever you [24:20] want it to be called and then inside of [24:22] it you're going to Define all of the [24:25] different methods or functions that must [24:28] be used by any class that implements [24:32] this abstract class so it's just random [24:34] function and it could have an attribute [24:37] in it or it could have whatever so [24:38] there's an abstract class and then you [24:40] could also use something that I almost [24:43] never use which is call inside of a [24:45] class and if it is defined inside of a [24:47] class what this is going to do is [24:49] provide method overloading but since PHP [24:51] isn't strongly typed there's really no [24:52] reason to use it now I just wanted to [24:54] briefly give you an idea that I mean I [24:56] covered pretty much everything but want [24:58] to give you an idea of how this is used [25:00] and how this is used in things like well [25:02] I'm going to show you this this is very [25:03] simple let's say I wanted to create a [25:06] way to very quickly be able to or very [25:09] easily be able to define the title [25:11] description keywords an author for my [25:13] website and also provide ways to get [25:15] those titles and also provide ways to [25:18] create the opening part of my HTML [25:21] document and like I said I'm dumbing [25:22] this down a lot okay so I would go in [25:25] and Define all these functions and all [25:27] this information I then then inside of [25:29] my website could just do this I would [25:31] say require and site info.in is the name [25:35] of this file right here I could just [25:37] come in here and very quickly whip out a [25:39] site okay now things normally aren't [25:41] done that way because you're normally [25:42] pulling data from databases and setting [25:44] things up right so what I decided to do [25:46] is go into WordPress and I did a ton of [25:49] tutorials and this is how WordPress and [25:51] every customer management system works [25:53] this is it so you can see here I'm [25:55] including data that I want to use or [25:57] functions I want to execute and you can [25:59] see right here I have things like gith [26:01] header this is WordPress and this is [26:03] automatically going to pull that [26:04] information from this file and you can [26:07] see right here that this is going to [26:08] call a function and it's going to do all [26:10] kinds of customized things using PHP [26:13] right inside of your web page okay so [26:15] that is just a rundown of object [26:17] oriented programming in general I [26:19] covered this stuff in my WordPress [26:20] tutorials like crazy so if you want to [26:23] see more examples of how all this is set [26:25] up I have WordPress tutorials that cover [26:27] it in extreme detail I've about 80 [26:29] videos so all of the code is available [26:31] in the description please leave your [26:33] questions and comments below otherwise [26:35] till next time