dgj:
    恕我愚钝,我的服务器是IIS5,PHP版本4.06,PEAR库是不是一个
扩展库,还有如能对如何模拟实现[!!!自动调用!!!]析购函数加以
详细说明,则万分感谢。

解决方案 »

  1.   

    参考:
    http://php.net/register_shutdown_function
      

  2.   

    qsnake:    先道个谢。register_shutdown_function的说明如下:
    Description
    int register_shutdown_function ( string func)
    Registers the function named by func to be executed when script processing is complete. 好像跟我所说的有些不同吧,我的意思是如果定义了一个类,不妨做个假设:
    其间我产生了若干个属性集合(数组),如果实例化的话(new 一个对象),
    最后使用完毕,unset时自动调用这个类的撤销函数(目的是把上面说的属性集合
    撤销),当然这些是安慰性的。但是如果是这个类使用完毕时[!!!我想写个日志!!!]呢???  register_shutdown_function,看它的意思应该是注册一个func函数,使得当
    这个脚本执行完毕时执行这个函数。
      

  3.   

    又发现手册中有如下描述:
    Note: There are no destructors in PHP 3 or PHP 4. You may use register_shutdown_function() instead to simulate most effects of destructors. Destructors are functions that are called automatically when an object is destroyed, either with unset() or by simply going out of scope. There are no destructors in PHP. 看来没有析购是肯定的了,但是,如果用register_shutdown_function模拟的
    化,我怎么判断这个对象确实被这个脚本引用并实例化了呢???
      

  4.   

    sorry,对php的oop研究不是很深,仔细钻研一下pear等等这些出色的代码吧