Created
July 5, 2020 08:59
-
-
Save phpfiddle/62f16c3173ceff4a94ae069f6e3bbecc to your computer and use it in GitHub Desktop.
[ Posted by Mukesh ] THIS IS TEST REPO FOR OOPS CONCEPTS/PRATICE
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function dd($arr){ | |
echo "<pre>"; | |
print_r($arr); | |
}; | |
Class ParentClass{ | |
public function myFunction(){ | |
return 'hey called from parent'; | |
} | |
} | |
Class ChildClass extends ParentClass{ | |
public function myFunction(){ | |
return 'hey called from child'; | |
} | |
} | |
$obj1 = new ParentClass(); | |
$obj2 = new ChildClass(); | |
dd($obj1->myFunction()); | |
dd($obj2->myFunction()); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment