Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:65533 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 12886 invoked from network); 31 Jan 2013 11:00:18 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 31 Jan 2013 11:00:18 -0000 Authentication-Results: pb1.pair.com header.from=sebastian.krebs.berlin@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=krebs.seb@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.180 as permitted sender) X-PHP-List-Original-Sender: krebs.seb@gmail.com X-Host-Fingerprint: 74.125.82.180 mail-we0-f180.google.com Received: from [74.125.82.180] ([74.125.82.180:43657] helo=mail-we0-f180.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 8E/D2-09318-FBE4A015 for ; Thu, 31 Jan 2013 06:00:16 -0500 Received: by mail-we0-f180.google.com with SMTP id k14so1951432wer.11 for ; Thu, 31 Jan 2013 03:00:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:sender:x-google-sender-delegation :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type; bh=mbfBPZCdaFiJZS6QCcuHxpra9FJPa5Zc+4adBoxxb1I=; b=dLq+FuBbnAxUb7m8oj0b8+vnTZScFtIhI2FqLGcoUkA6+wPJy2I4zPqJrfHNPoMVEw +XEduuG2lalT+F4JG9UHWqvW583qiXfGPo0hyJB/m3ocyBs5gBuCkiITc2/hEtNvfmIL RfPpFzxv3dbEe6e7NQ2KC//GOMVM0uKawNR8HNt9YCINU5dTmb7OGafB8ZXeTRno/+h8 AnbfH13swQmE+7d3ZzRZdeTeREmu3+oYhLwHxPjOFvFIjROarSfJecDB80kfZxdtuuh6 zH9Q5cvMXCbXZVmNBDVyzSSnH0lysBf+EEI4jH9X0XKF9hRR4EIpU3lK4D+YynFj/y8k ZfjA== MIME-Version: 1.0 X-Received: by 10.180.101.99 with SMTP id ff3mr14164169wib.21.1359630007368; Thu, 31 Jan 2013 03:00:07 -0800 (PST) Sender: sebastian.krebs.berlin@gmail.com X-Google-Sender-Delegation: sebastian.krebs.berlin@gmail.com Received: by 10.216.119.70 with HTTP; Thu, 31 Jan 2013 03:00:07 -0800 (PST) In-Reply-To: <075AE850888292488D400D9632DFE6E102400AA5@DC01.aquacool.local> References: <510A3B71.7060508@hoa-project.net> <075AE850888292488D400D9632DFE6E102400AA5@DC01.aquacool.local> Date: Thu, 31 Jan 2013 12:00:07 +0100 X-Google-Sender-Auth: NbZhgVdbgS_eVkak0emALJXt_KM Message-ID: To: Chris Wright Cc: "ivan.enderlin@hoa-project.net" , "internals@lists.php.net" Content-Type: multipart/alternative; boundary=f46d044280e89d7b5304d493878e Subject: Re: [PHP-DEV] Proposal: php://memory/ (& ://temp/) From: krebs.seb@gmail.com (Sebastian Krebs) --f46d044280e89d7b5304d493878e Content-Type: text/plain; charset=ISO-8859-1 2013/1/31 Chris Wright > > I propose the following syntax: > > > > php://memory/ > > php://temp//maxmemory: > > I would very much like to see this as well. > > Would this also allow you to open multiple pointers to the same bucket? > > For example would this work? > > > $fp = fopen('php://memory/foo', 'w+'); > > file_put_contents('php://memory/foo', 'data'); > > rewind($fp); // would this be necessary? > > echo stream_get_contents($fp); // outputs 'data' > Everything else wouldn't make much sense, because why else should you need to define an id for it? Bu whats about file_put_contents('php://memory/foo', 'data'); $fp = fopen('php://memory/foo', 'w+'); 'file_put_contents()' closes the stream after writing. I would expect, that the engine will cleanup the memory (at least sooner or later), but then I open it again. Additional why don't you just pass the open stream around, if you need to access it at multiple places? Regards, Sebastian > > Best regards > Chris Wright > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > -- github.com/KingCrunch --f46d044280e89d7b5304d493878e--