Skip to content

Instantly share code, notes, and snippets.

@pavanBS
Created April 20, 2017 07:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save pavanBS/6a85d9a08a473fdb9bfd3c6f4b29f196 to your computer and use it in GitHub Desktop.
Save pavanBS/6a85d9a08a473fdb9bfd3c6f4b29f196 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