im not 100 percent sure but i think that doing this with web based php would not be possbile .. as your server should open a new instance of php for every request.. then a garbage collector would go to work on your shite and make it all go away...
i think you asking for something like a what a java server like oracle9i implements called a Java Container... where Java is always running in a shared but internally partioned memory segment... and each java request gets handled by the Container.... actually each Jsp page is actually in a sense its own little persistant application running under the container... so it does not have to be reparsed every page hit... and you can also use staticly declared variables to be persistant across each page load, not just across a specific users hits using a session variable.. interesting stuff that is
i think the container is hard to make happen... as even apache's tomcat doesn't get around to making a full java container... as you would need full knowledgable parcipiation of the server to function...
i don't see any malloc like functions anywhere to be found in the php functino list...
perhaps im just confused about how apache handles mod_php... is that a persistant segment of memory that apache handles for use by php?
now ill rate the factual knowledge confidence in this post at about 50% as im most a php guy and not a java guy... so i welcome anyone who can correct me.. and mabye someone that knows more about this can hopefully shed more light on this thread