public function stream_write($data) { if (self::ERROR_WRITE === self::$error) { return 0; } self::$dir[$this->path] .= $data; return strlen($data); }