i read that both are same object overloading is old name of iteration, but i have doubt so please any one can help in this regard
what i know that :
* Iteration :- Loop the object
* used to Display property name and class value.
* foreach loop used : - only used in array and object iteration.
here i give example of iteration:
CODE
<?php
class abc{
var $user="Raju";
var $city="Delhi";
var $age= 25;
}
$obj=new abc;
echo "<table border=1>";
echo "<tr><td> property Name </td><td> property Value </td></tr>";
foreach($obj as $p=> $x){ echo "<tr><td> $p </td><td> $x</td> </tr>"; }
echo "</table>";
?>
class abc{
var $user="Raju";
var $city="Delhi";
var $age= 25;
}
$obj=new abc;
echo "<table border=1>";
echo "<tr><td> property Name </td><td> property Value </td></tr>";
foreach($obj as $p=> $x){ echo "<tr><td> $p </td><td> $x</td> </tr>"; }
echo "</table>";
?>
output:-
property Name property Value
user Raju
city Delhi
age 25
every thing is fine but i am not fully understood this.
how it works. what is the behavior of this iteration. how we can say that it is object overload.
thanks

