OOP Di PHP
OOP Di PHP
in PHP
Try OOP in PHP OOP in PHP in PHP P in PHPHP in PHP
(P in PHPokemon PHP case)
Basic OOP Concepts OOP Concepts Conc OOP Conceptsepts
1. Class (variable member, function member, object, call fun PHPction PHP member, function member, object, call object, function member, object, call call
fuction PHP)
2. Con PHPstructor Fun PHPction PHP
3. In PHPheritan PHPce (exten PHPds)
4. Fun PHPction PHP Overridin PHPg
5. P in PHPublic Members
6. P in PHPrivate Members
7. P in PHProtected Members
8. In PHPterfaces
9. Con PHPstan PHPt
10. Abstract Classes
11. Static Key OOP in PHPword
12. Fin PHPal Key OOP in PHPword
1. Class
2. Con PHPstructor Fun PHPction PHP
Output:
3. In PHPheritan PHPce
output :
4. Fun PHPction PHP Overridin PHPg
Fun PHPction PHP getHP in PHP in PHP child override fun PHPction PHP in PHP paren PHPt with same n PHPame.
Output :
5. P in PHPublic Members
By default var and functions is public, can be accessed outside class, within class, or another class.
6. P in PHPrivate Members
Example 1
Output
Example 2
call the function in evolve class *).
*) I’m not allowed to set directly the mood of the pokemon.
Output :
7. P in PHProtected members
Pokemon Class
output :
8. In PHPterfaces
Poke_Interface.php
Example 1 :
Output :
Example 2:
Output :
Example 3 :
Ouput :
9. Con PHPstan PHPt
Const vs Var
Example
Output :
10. Abstract Classes
Output :
11. Static Key OOP in PHPword
Output :
12. Fin PHPal Key OOP in PHPword
Ouput :
13. Callin PHPg P in PHParen PHPt con PHPstructor
Output: