php中也应该是一样的。(想的,没测试过)只是把 out result 改成 &$result 就可以了。具体调用方式见:
http://coolstr.cnblogs.com/archive/2005/08/25/222440.html