看手册的 章 18. 类与对象(PHP 4)

解决方案 »

  1.   

    paths 是一个具有thumb 成员的对象
      

  2.   

    class TempPaths{
      var $tPaths;  function setPaths( $paths ){
         $this->tPaths = $paths;
      }
    }class Paths{
      var $root,$path,$filename;
      var $paths;  function setPaths($p){
       list($this->root,$this->path,$this->filename) = $p;
      }
    }$p = array('c://','windows/','regedit.exe');
    $paths = new Paths();$paths->setPaths($p);$temp = new TempPaths();$temp->setPaths($paths);echo $temp->tPaths->root;
    echo $temp->tPaths->path;
    echo $temp->tPaths->filename;
      

  3.   

    等于一个类里面的变量存放的是另一个类的实例?这么做的意义在于什么?------------------------------
    Then what's the meaning of using another function in a function called by a third function ?
    It is for application.