Portál AbcLinuxu, 4. listopadu 2025 20:40
function(){
$a = 'Ahoj';
echo $a;
};
Řešení dotazu:
function foo(){
$a = 'Ahoj';
echo $a;
};
foo();
pokud se s ta promenna $a nikde nepouziva, lze zkratit na:
function foo(){
echo 'Ahoj';
};
class A
{
public static function getText($text = null)
{
return $text;
}
}
echo A->getText("co ma funkce vypsat");
class A {
public static function getText($text = null) {
return $text;
}
}
echo A::getText("co ma funkce vypsat");
Tiskni
Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.