Hello!

I have an object:
class Entry
{  var $ip;
    var $host;
}

Which is stored in an array:
$aLines = array();
...
array_push($aLines, new Entry($ip)); // Do this several times

Now I want to resolve the hostname from ip adresses:
foreach ($aLines as $entry)
{ if ($entry->host == "")
        $entry->host = "Teststring";
   print $entry->host."\n"; // prints "Teststring"
}

// Testoutput
foreach ($aLines as $entry)
{ print $entry->host."\n"; // prints empty string!
}

Why is host in the second loop empty again?

Martin



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to