php4中类中的方法,也就是函数都是public的,和c++等不一样,不能用public和private等修饰符所以有些人就喜欢以_开头的函数来表示是private的,这个是编程的习惯而已

解决方案 »

  1.   

    __开头也是他们的习惯把不过php4中的内有两个魔术函数 __sleep 和 __wakeupphp5中有 
    __construct, __destruct __call, __get, __set, __isset, __unset __sleep, __wakeup, __toString, __set_state, __clone and __autoload
      

  2.   

    那么function _setTemplate 这样定义的函数是私有的使用上有什么限制呢?
      

  3.   

    In php4, all the functions are public.
    You can read PHP manual to know the difference about "public", "private", "protect"...