将字符串写入内存并传递地址

Write a string to memory and pass the address around

背景:我有一个构造成本很高的对象,所以我想将它从 Web 脚本传递到后端脚本而无需重新构造。

我喜欢 this question 中的方法。我很确定这对我有用。但是是否可以将字符串写入内存,并将内存地址传递给后端脚本(将其视为文件名)以便它可以读取字符串。

查看PHP中的共享内存函数..

http://php.net/manual/en/ref.shmop.php

当然,从 "backend script" 获取数据将取决于所使用的语言。