rxbanditboy1112 Posted April 7, 2008 Share Posted April 7, 2008 I've been programming with php for a while now in a more script like way with some classes here and there. I am also experienced with java and c#. Now I am trying to rewrite my code to make it object oriented because that is what I am used to and definitely what makes sense. I was wondering does php have public, private and maybe even protected functions? Are all functions public? Furthermore, this style of programming makes me want to specify type, rather than just commenting on what type something should be. Is there a way I can declare a type to my variables? Also by default are variables in php set to public or private? THanks!! Link to comment https://forums.phpfreaks.com/topic/100015-public-and-private-functions/ Share on other sites More sharing options...
rhodesa Posted April 7, 2008 Share Posted April 7, 2008 Those features were added to PHP5. By default, everything is public. Read all about PHP5 OOP here: http://us3.php.net/oop5 Link to comment https://forums.phpfreaks.com/topic/100015-public-and-private-functions/#findComment-511464 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.