I must convert a web application from php 5 to php 4, but I'm having some problems, especially with objects. I'm getting a error in a setter function with array arg (parse error, unexpected '=', expecting '(' on line 20). The code:
class Fecha extends DateTime {
var $dias = array();
function DateTime($fechaHora = 'now') {
parent::__construct($fechaHora, new DateTimeZone('Europe/Madrid'));
}
/*
* Getters / Setters
*/
function setDias($dias) {
if (count($dias) == 7)
self::$dias = $dias; // Here is where the error is thrown
}
}
and I call the class like that:
Fecha::setDias(array('Luns', 'Martes', 'Mércores', 'Xoves', 'Venres', 'Sábado', 'Domingo'));