Jump to content

set value for class


clankill3r

Recommended Posts

i have:

 

class Host {

public $hostname;
public $foundResults;

public function __construct($hostname) {
	$this->$hostname = $hostname;
	$foundResults = array();
}
}

 

but when i create a object the hostname doesn't get set, instand a new propert get's created

What do i do wrong?

 

Host Object

(

    [hostname] =>

    [foundResults] =>

    [www.google.nl] => www.google.nl

)

Link to comment
https://forums.phpfreaks.com/topic/250901-set-value-for-class/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.