The var: / / protocol implemented below, given the url "var: / /foo" will read / write data to / from $GLOBALS["foo"].
The example below implements a var:// protocol handler that allows read/write access to a named global variable using standard filesystem stream functions such as fread(). The var:// protocol implemented below, given the url "var://foo" will read/write data to/from $GLOBALS["foo"].