What is the default access identifier for class members
PHP Code
Class Person { var $name; protected $id; Private $hidden; public $username;}
What access control is the $name class member variable in the above code? (It is followed by three variables, followed by protected private public.) )
------Solution--------------------
Default is PUBILC
But in order for everyone to develop good habits and future adaptation to PHP6, it is recommended to use public instead of Var
------Solution--------------------
If you don't declare, then he's public.
Explore
Reference:
Default is PUBILC
But in order for everyone to develop good habits and future adaptation to PHP6, it is recommended to use public instead of Var
Oh, function does not write the Access ID is also public, right?
I read the PHP book did not say, is really confusing, Java does not write access control character meaning and private,public,protected are not the same.