Xu Wei Jie Posted March 22, 2009 Share Posted March 22, 2009 Is it possible to declare functions with private access without the use of a class in PHP? TIA Quote Link to comment https://forums.phpfreaks.com/topic/150619-php-functions-with-private-access/ Share on other sites More sharing options...
trq Posted March 22, 2009 Share Posted March 22, 2009 No, and that makes little sense. You would no longer be able to execute them. Quote Link to comment https://forums.phpfreaks.com/topic/150619-php-functions-with-private-access/#findComment-791166 Share on other sites More sharing options...
Xu Wei Jie Posted March 22, 2009 Author Share Posted March 22, 2009 if only other functions can access them.... I wish to design a library with private functions but I guess it is not possible. Quote Link to comment https://forums.phpfreaks.com/topic/150619-php-functions-with-private-access/#findComment-791170 Share on other sites More sharing options...
Maq Posted March 22, 2009 Share Posted March 22, 2009 PHP OOP - Look at "method visibility". Quote Link to comment https://forums.phpfreaks.com/topic/150619-php-functions-with-private-access/#findComment-791269 Share on other sites More sharing options...
Xu Wei Jie Posted March 23, 2009 Author Share Posted March 23, 2009 However, I wish to do it without the design of a class.... keke Quote Link to comment https://forums.phpfreaks.com/topic/150619-php-functions-with-private-access/#findComment-791592 Share on other sites More sharing options...
RichardRotterdam Posted March 23, 2009 Share Posted March 23, 2009 if only other functions can access them.... I wish to design a library with private functions but I guess it is not possible. Sorta sounds like you want to use namespaces. However this is for php 5.3 or above. Quote Link to comment https://forums.phpfreaks.com/topic/150619-php-functions-with-private-access/#findComment-791596 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.