Portál AbcLinuxu, 7. května 2025 21:57
Ř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 test/formatter.php
slape, ikdyz jeden test selhava.
Tiskni
Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.