PHP runs in a shared-nothing environment, which in this context means that every web request is run in a clean environment. You can not access another request\'s data excep
Here is a relatively simple example that illustrates what can happen if you are not careful about modifying shared objects.
Create a new Rails project: rails test
Create a new file lib/misc.rb and put in it this:
class Misc
@xxx = 'Hello'
def Misc.contents()
return @xxx
end
end
ruby script/generate controller Posts indexChange app/views/posts/index.html.erb to contain this code:
<%
require 'misc'; y = Misc.contents() ; y << ' (goodbye) '
%>
<%= y %>
(This is where we modify the implicitly shared object.)
config/routes.rb. ruby script/server and load the page /posts several times. You will see the number of ( goodbye) strings increasing by one on each successive page reload.