Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:65509 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 11790 invoked from network); 30 Jan 2013 15:57:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Jan 2013 15:57:29 -0000 Authentication-Results: pb1.pair.com header.from=tyra3l@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=tyra3l@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.210.177 as permitted sender) X-PHP-List-Original-Sender: tyra3l@gmail.com X-Host-Fingerprint: 209.85.210.177 mail-ia0-f177.google.com Received: from [209.85.210.177] ([209.85.210.177:50860] helo=mail-ia0-f177.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 6B/63-09318-5E249015 for ; Wed, 30 Jan 2013 10:57:26 -0500 Received: by mail-ia0-f177.google.com with SMTP id h8so2544558iaa.36 for ; Wed, 30 Jan 2013 07:57:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=JjdZjLm0zT/iUGk5OGWq6VqRzSgCgNyxWhXuBaPgTGk=; b=oGg4cvNu0Wmm2xZ2cSNR049z3JZAvfSxQDAGx9QWevqe3t9/tJ3dCv46lBCUwlu5Zi gc6aWf1KZELD3UP+NHWVucDV6W7kY83UVjbmhG4icBOd0ZlcSgJkTObjUWcbK2KWxZzl XD+YM9lh/ibagFTn5C5h6mQHwrhIBrzI5eHMcYzve09ZFrBvNe4lasgikQNLHvktw5fy ZHBamCm6sg14v3MBUIGEPN5sWhQB7OXGJ6DQh08u/zseZUT79mTRYx2kfGCP7uzEVEMJ treb+Wilb98xvmDim+DDPWDQp7yGlaF6rC35yOMBIOU79A8twK5S4E2U8iDfpOevVnEO hkaw== MIME-Version: 1.0 X-Received: by 10.50.217.230 with SMTP id pb6mr4097920igc.43.1359561443600; Wed, 30 Jan 2013 07:57:23 -0800 (PST) Received: by 10.50.106.138 with HTTP; Wed, 30 Jan 2013 07:57:23 -0800 (PST) In-Reply-To: <1359560655.44471.YahooMailNeo@web133004.mail.ir2.yahoo.com> References: <1359498582.20362.YahooMailNeo@web133002.mail.ir2.yahoo.com> <51085497.3090504@sugarcrm.com> <1359560655.44471.YahooMailNeo@web133004.mail.ir2.yahoo.com> Date: Wed, 30 Jan 2013 16:57:23 +0100 Message-ID: To: hakre Cc: Stas Malyshev , "internals@lists.php.net" Content-Type: multipart/alternative; boundary=14dae93411e7e56a0d04d48390db Subject: Re: [PHP-DEV] echo new SplFileObject(__FILE__); From: tyra3l@gmail.com (Ferenc Kovacs) --14dae93411e7e56a0d04d48390db Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Wed, Jan 30, 2013 at 4:44 PM, hakre wrote: > > > ----- Urspr=C3=BCngliche Message ----- > > > Von: Stas Malyshev > > Gesendet: 0:00 Mittwoch, 30.Januar 2013 > > Betreff: Re: [PHP-DEV] echo new SplFileObject(__FILE__); > > > > > > __toString is mapped to current() for SplFileObject: > > http://www.php.net/manual/en/splfileobject.current.php > > > > it's not documented for some reason, I think it makes sense to file a > > docs bug on that. > > Thanks for your answer. > > I know that there is code in there that does this and I also got into the > know that it is not properly documented. > > I just write this to clarify that I'm more interested in the why it has > been coded that way. > > It does not make much *sense* to me and I want to learn more. > > Also I don't mean this explicit technically. I could blame the version > control, pick the authors name and email that person; however some time h= as > passed and more users are using it not only the original author so I ask = in > internals first. Just for clarification. > > I would guess the idea was that SplFileObject already implements the Iterator interfaces and iterating the object would give you the lines of the file, so echo $object should echo the current line. But this isn't that strong of an argument, and I think that following what SplFileInfo does would be more sensible (echoing the filename), but I'm not sure change would worth breaking BC for. --=20 Ferenc Kov=C3=A1cs @Tyr43l - http://tyrael.hu --14dae93411e7e56a0d04d48390db--