I have written the PHP code below in order to create a dynamic matrix with different count of columns per row but PHPStorm says the row variable is not defined. please help.
class reply
{
public $text;
private $row = array(array());
private $rowIndex = 0;
private $colIndex = 0;
public function Add($menu)
{
$this->$row[$this->rowIndex][$this->colIndex] = $menu;
$this->colIndex++;
}
public function NextRow()
{
$this->rowIndex++;
$this->colIndex = 0;
}
}