7 points · by iamelgringo · 18y ago · 8 comments
Can somebody tell me, how namespaces work?
Say, without namespaces you would do it like this:
function isBig($Number)
{
return ($Number>1000);
}
if (isBig(50)) echo '50 is big';
How would this look like when namespaces are used? namespace yo
{
function isBig($number) {
return ($number>1000);
}
}
if (yo::isBig(50)) echo '50 is big'; class yo
{
function isBig($number)
{
return ($number>1000);
}
}
if (yo::isBig(50)) echo '50 is big';