Skip to content

Instantly share code, notes, and snippets.

@bhavinrana07
Last active May 20, 2020 06:18
Show Gist options
  • Save bhavinrana07/cb4cacd3ff1417b2d69121bb42ff7a68 to your computer and use it in GitHub Desktop.
Save bhavinrana07/cb4cacd3ff1417b2d69121bb42ff7a68 to your computer and use it in GitHub Desktop.
interface in php
<?php
Interface MyInterface {
public function getName();
public function getAge();
}
class MyClass implements MyFirstInterface{
public function getName() {
echo "My name A".'<br>';
}
public function getAge(){
echo "My Age 12";
}
}
$obj = new MyClass;
$obj->getName();
$obj->getAge();
?>
OUTPUT:
My name A
My Age 12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment