Even though their names will be the same, you can have more than one //memory or //temp stream open concurrently; each time you fopen() such a stream, a NEW stream will be opened independently of the others.
This is hinted at by the fact you don't add any unique identifier to the path when creating such streams, but isn't said explicitly.
<?php
$hello = fopen('php://memory', 'r+'); $php = fopen('php://memory', 'r+');
$world = fopen('php://memory', 'r+'); fputs($hello, "Hello ");
fputs($php, "PHP ");
rewind($php);
fputs($world, "World!");
rewind($hello);
rewind($world);
echo '[', stream_get_contents($hello), '][', stream_get_contents($php), '][', stream_get_contents($world), ']';
?>