Skip to content

Instantly share code, notes, and snippets.

@pavanBS

pavanBS/A.php Secret

Last active June 28, 2017 01:44
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 pavanBS/fce3784878b95d13cc0573f8d65d6664 to your computer and use it in GitHub Desktop.
Save pavanBS/fce3784878b95d13cc0573f8d65d6664 to your computer and use it in GitHub Desktop.
<?php
class A {
public function printItem($string) {
echo ' Hi : ' . $string;
}
public function printPHP() {
echo 'I am from valuebound' . PHP_EOL;
}
}
class B extends A {
public function printItem($string) {
echo 'Hi: ' . $string . PHP_EOL;
}
public function printPHP() {
echo "I am from ABC";
}
}
$a = new A();
$b = new B();
$a->printItem('Raju');
$a->printPHP();
$b->printItem('savan');
$b->printPHP();
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment