what is the different between
public function something()
{
}
and
function something()
{
}
any explaination? which more better?
PHP/4 did not implement visibility yet. When it was added in PHP/5, a missing visibility keyword was made synonym of public
so existing code would not break.
If it's legacy code, my advice is to leave it as is until you have the chance to review the code and pick an adequate visibility. If it's new code, you should make it explicit.