PHP classes why use public keyword?
Yes, public
is the default (see visibility docs).
People add it, so it is consistent with all the other methods / properties.
Furthermore, if you want to declare a property public and don't want to use public
you will need to use var
, which is not recommended and will likely be deprecated at some point.