Salve a tutti,
volevo chiedervi un chiarimento sull'uso delle costanti all'interno di una funzione costruttrice, vi mostro inanzitutto l'esempio in questione:
Codice PHP:
<?PHP
class Transform
{
var $tab;
var $id;
var $xsl;
var $css;
var $lang;
function Transform($tab,$id = all,$xsl, $css = "default", $lang)
{
$this->tab = $tab;
$this->id = $id;
$this->xsl = $xsl;
$this->css = $css;
$this->lang = $lang;
}
}
$test = new Transform("texts", "tutto", "html", "it");
print_r($test);
?>
nell'esecuzione ricevo il seguente output:
Warning: Missing argument 5 for transform() in /var/www/portfolio/class_transform.php on line 11
transform Object ( [tab] => texts [id] => tutto [xsl] => html [css] => it [lang] => )
la domanda è: ...a cosa servono le costanti se poi le devo ridichiarare quando chiamo la funzione?
:master: Presumo che qualcosa non funga....
bye
_And