Your class should be as follows dark_omen:
<?php
class myClass{
var $h;
//constructor
function __construct(){
$this->$h = "Hello";
}
function write(){
return $this->$h;
}
}
?> So basically for any instance field of the class or when you want to return a value which uses an instance field in its computations, you have to specify
$this-> in your code. Also, your constructor for the class is always named
__construct. And that should make your class work as you want it to.