Skip to content

Instantly share code, notes, and snippets.

@phpfiddle
Created July 5, 2020 08:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phpfiddle/62f16c3173ceff4a94ae069f6e3bbecc to your computer and use it in GitHub Desktop.
Save phpfiddle/62f16c3173ceff4a94ae069f6e3bbecc to your computer and use it in GitHub Desktop.
[ Posted by Mukesh ] THIS IS TEST REPO FOR OOPS CONCEPTS/PRATICE
<?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