Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- interface parentClass1{
- function calc($a, $b); //Can not set access modifier
- }
- interface parentClass2{
- function sub($c, $d);
- }
- class childClass implements parentClass1, parentClass2{
- public function calc($a, $b){
- echo $a + $b;
- }
- public function sub($c, $d){
- echo $c - $d;
- }
- }
- $test = new childClass();
- $test->calc(20,35);
- echo "<br>";
- $test->sub(75, 30);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement