Portál AbcLinuxu, 2. listopadu 2025 09:49
Řešení dotazu:
class HTMLTextNode
{
function text($t = null)
{
echo 'blabla';
}
}
class HTMLCommentNode
extends HTMLTextNode
{
function text()
{
echo 'omgomg';
}
}
a mel bys to mit nejak takto:
class HTMLTextNode
{
function text($t = null)
{
echo 'blabla';
}
}
class HTMLCommentNode
extends HTMLTextNode
{
function text($t = null)
{
echo 'omgomg';
}
}
class HTMLTextNode{
public function text($t = NULL){
echo "I am HTMLTextNode and use \$t: $t.";
}
};
class HTMLCommentNode extends HTMLTextNode {
public function text(/*něco tu chybí*/){
echo "I am HTMLCommentNode.";
}
};
i ve variantě metod jako static, ti to udělá, oprav to
Opraveno, error zmizel ale stejně to nefunguje, kód se nezformátuje
Nepoužívá to někdo?
https://github.com/markwatkinson/php-html-formatter
Díky moc.
test/formatter.php slape, ikdyz jeden test selhava.
Tiskni
Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.