![]() |
PHP5 OOP Standards - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: PHP5 OOP Standards (/showthread.php?tid=19770) Pages:
1
2
|
PHP5 OOP Standards - El Forum - 06-18-2009 [eluser]Dam1an[/eluser] [quote author="sl3dg3hamm3r" date="1245351742"][quote author="Dam1an" date="1245351368"]I've never seen anyone write public/protected/private[/quote] ? I would highly suggest that for the sake of proper OOP design...[/quote] N0xie picked up on it... maybe I should have added more emphasis to and lol PHP5 OOP Standards - El Forum - 06-18-2009 [eluser]IamPrototype[/eluser] I actually just wrote public for the heck of it. Normally in my scripts it's "var $name". I think default is public so it's faster to just skip the public. I might have confused some people here with my topic, sorry guys! Since n0xie wrote that it's PHP4 syntax I'm using. I'm willing to change my habit and write "public $var" or just plain simple, "$var" (guess that would work either way), since my server is up to date with PHP5, so I see no point in using PHP4 syntax. ---- Edit: Would it make my scripts any more safe, if I write "private" in front of my instace ($ci). Just curious since you don't need to get instace anywhere else! (Right now I'm talking about libraries). |