Q:

Problem with the call to method inside the class

I'm learning PHP and in this lesson, I'm learning to call a method inside the class. I don't understand the reason why the method that shows the numbers in the cells of my table doesn't show anything. I reviewed it a lot of times but I can find the problem. Could you?
<?php 

class Tabla {

    private $row;
    private $column;
    private $mat = array();
    
    public function __construct ($fila, $columna) {
        $this -> row = $fila;
        $this -> column = $columna;
    }

    public function cargar ($fil, $col, $tex) {
        $this -> mat[$fil][$col] = $tex;
    }

    public function mostrar ($fil, $col) {
        echo '<td width="50" height="25">'. $this -> mat[$fil][$col] .'</td>';
    }

    public function graficar () {
        echo '<table border="1">';
        
            echo '<tbody>';
                for($f = 1; $f <= $this -> row; $f++) {
                    echo "<tr>";
                    for($i = 1; $i <= $this -> column; $i++) {
                        $this -> mostrar($fil, $col);
                    }
                    echo "</tr>";
                }
            echo '</tbody>';
        echo '</table>';
    }

}

$tablita = new Tabla (3, 3);
$tablita -> cargar(1, 1, "1");
$tablita -> cargar(1, 2, "2");
$tablita -> cargar(1, 3, "3");
$tablita -> cargar(2, 1, "4");
$tablita -> cargar(2, 2, "5");
$tablita -> cargar(2, 3, "6");
$tablita -> cargar(3, 1, "7");
$tablita -> cargar(3, 2, "8");
$tablita -> cargar(3, 3, "9");
$tablita -> graficar ();

A:

The problem in my exercise was in the method "graficar" when it use the "mostrar" method... because I setted vars who don't exist, so in this case we should use the vars of the loops for, that represents the rows and columns of the table, that way:
public function graficar () {
        echo '<table border="1">';
        
            echo '<tbody>';
                for($f = 1; $f <= $this -> row; $f++) {
                    echo "<tr>";
                    for($i = 1; $i <= $this -> column; $i++) {
                        $this -> mostrar($f, $i);
                    }
                    echo "</tr>";
                }
            echo '</tbody>';
        echo '</table>';
    }

