<p>Is there a standard way of dealing with globally scoped variables in PHP? Session scoped? </p>

<p>From the research I've done, it looks like the options are mostly add-ons or external. APC might work, but would be limited to a single PHP instance and not so useful for a farm of servers. <em>Memcached</em> seems like it would work, but I was hoping to find something within PHP. </p>

<p>Does its stateless approach keep there from being a standard method for handling this?</p>

[{'answer_id': 50658, 'author': 'hasseg', 'author_id': 4111, 'author_profile': 'https://Stackoverflow.com/users/4111', 'pm_score': -1, 'selected': False, 'text': '<p>You can do session variables with <a href="http://www.php.net/manual/en/reserved.variables.session.php" rel="nofollow noreferrer">$_SESSION</a>.</p>\n'}, {'answer_id': 51018, 'author': 'paan', 'author_id': 2976, 'author_profile': 'https://Stackoverflow.com/users/2976', 'pm_score': 1, 'selected': False, 'text': "<p>A persistent layar is the only way to go with php. Either file based solution or database.  </p>\n\n<p>php natively doesn't provide any mechanism to do application scope variable.</p>\n"}]
['https://Stackoverflow.com/questions/50652', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/-1/']