Ciao ho controllato, ma $val è un numero.
Ho fatto echo $val; e mi visualizza correttamente 1, 2, 3, 4, ... fino a 19.
Questo è il file serieA.giornata.inc.php se può essere utile:
Codice PHP:
class Giornata
{
private $_properties;
public $partite;
function _get($propertyName)
{
if (!array_key_exists($propertyName, $this->_properties))
throw new Exception("Invalid property value.");
if (method_exist($this, 'get' . $propertyName))
return call_user_func(array($this, 'get' . $propertyName));
else
return $this->_properties[$propertyName];
}
function _set($propertyName, $value)
{
if (!array_key_exists($propertyName, $this->_properties))
throw new Exception("Invalid property value.");
if (method_exist($this, 'set' . $propertyName))
return call_user_func(array($this, 'set' . $propertyName), $value);
else
$this->_properties[$propertyName] = $value;
}
public function _construct()
{
$_properties = array('andata' => NULL, 'ritorno' => NULL);
}
}
class Partita
{
//Dichiaro le proprietà che ci sono all'interno della classe:
private $_properties;
function _get($propertyName)
{
if (!array_key_exists($propertyName, $this->_properties))
throw new Exception("Invalid property value.");
if (method_exist($this, 'get' . $propertyName))
return call_user_func(array($this, 'get' . $propertyName));
else
return $this->_properties[$propertyName];
}
function _set($propertyName, $value)
{
if (!array_key_exists($propertyName, $this->_properties))
throw new Exception("Invalid property value.");
if (method_exist($this, 'set' . $propertyName))
return call_user_func(array($this, 'set' . $propertyName), $value);
else
$this->_properties[$propertyName] = $value;
}
public function _construct()
{
$_properties = array('casa' => NULL, 'ospite' => NULL);
}
}