I've been working on this problem for hours now, and I can't tell if I'm just losing my mind or there is actually a php issue here.
I am using PHP v.4.3.3
I have an object variable is being mysteriously set to 0 from an null state after we switch to another function.
Here is the code that calls my object:
$question = new Question();
$question->set_response(null);
Here is the object:
class Question {
var $response;
function set_response($response=null) {
$this->response = $response;
print "In set_response: {$this->response}<br>";
$this->save();
return $this->response;
} // End function set_response
function save() {
print "In save: {$this->response}<br>";
} // end function save()
} // end class Question
And here is the output:
In set_response:
In save: 0
If anyone can help me, that'd be great. I'm ripping my hair out here.
Thanks,
Erica