Example class registered as stream wrapper

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"].

$fr = fopen('db://testuser@localhost/testdb', 'r');$fw = fopen('db://testuser:testpassword@localhost/testdb', 'w');//The two forms above are accepted : for the former, the default password "" will be used