Public Visibility
The public keyword is part of the three keywords to define visibility of a method, property or constant. It is the lowest level of visibility: it doesn’t restrict usage.
public is also the default visibility when it is omitted.
<?php
class Elephpant {
// public constant
const HABITAT = 1;
public $trunkLength = 2;
}
$elephpant = new Elephpant;
echo $elephpant->trunkLength;
echo Elephpant::HABITAT;
?>