Type Hinting in PHP OOPS
.png)
<?php //Type Hinting //Example 1 // function test(array $arr) // { // echo "<table>"; // foreach($arr as $k => $v) // { // echo "<tr><td>$k</td><td>$v</td></tr>"; // } // echo "</table>"; // } // $array = "hkhhlhlh"; // test($array); //Example 2 interface test { public function doSomething (); } class ABC implements test { public function doSomething () { echo "Doing Something from ABC Class" ; } } class XYZ implements test { public function doSomething () { echo "Doing Something from XYZ Class" ; } public function doSomethingElse () { echo "Doing Something Else" ; } } function test ( ABC $a...