I created an error handler class, and within the class constructor I have set the variable $this->debugMode = 'off'. I have a method within the class called setDebugMode($which) { ... } which either sets $this->debugMode = 'on' or = 'off'.
This part is working fine (I have placed echo's throughout to make sure).
I have also in the constructor put in the line:
set_error_handler(array(&$this,"eventWriter"));
Now the problem exists, when I try to access: $this->debugMode from within the eventWriter method, it always returns 'off' (because thats what I set it to by default in the constructor). Even if I call $eh->setDebugMode('on'); from the main script, when it gets around to the eventWriter method, it is still set to 'off'.
Is this because it is creating a new instance within itself? I thought that the & reference meant call itself rather than a new instance of itself.
Any suggestions would be greatly appreciated.