I'm trying to debug a class that I made. It always breaks and throw undefined variable on the logs I couldn't find a solution because I don't know what I'm doing wrong, I think it should work but not.
The undefined variable is on the erase() function, not in the show() function
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();
$s = $o->erase();