Quote:
Originally Posted by edgeprod
Would you suggest an alternate way of doing that than the current way?
Code:
public $returnText = 'Hello World!'; // Stores the string to return
Is there something inherently wrong with the way I'm doing it? I'd love to learn, if so.
|
You should use a constructor to initialize class members:
PHP Code:
class Hello {
private $returnText;
public function __construct() {
$this->returnText = "Hello World!";
}
}