Basic stream interfaces in PHP