I am trying to debug the class that I created. It always breaks and throws the undefined variable into the logs, I could not find a solution, because I do not know what I'm doing wrong, I think that it should work, but no.
The undefined variable is in the function erase(), not in the functionshow()
class pepe{
private $array = array();
function show(){
$this->erase();
print_r($this->array);
}
function erase(){
print_r($this->array);
}
}
$o = new pepe();
$s = $o->show();
source
share