Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:65444 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 70112 invoked from network); 29 Jan 2013 22:51:11 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Jan 2013 22:51:11 -0000 Authentication-Results: pb1.pair.com smtp.mail=tyra3l@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=tyra3l@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.210.172 as permitted sender) X-PHP-List-Original-Sender: tyra3l@gmail.com X-Host-Fingerprint: 209.85.210.172 mail-ia0-f172.google.com Received: from [209.85.210.172] ([209.85.210.172:48071] helo=mail-ia0-f172.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 7A/90-10721-E5258015 for ; Tue, 29 Jan 2013 17:51:10 -0500 Received: by mail-ia0-f172.google.com with SMTP id u8so1409033iag.31 for ; Tue, 29 Jan 2013 14:51:07 -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=s2/zEnhmoKesTgcp70gk89yk2LI6uy6daf2lXMljcNA=; b=B1e1iplQ2SuyUqXkNIEpokbNwOJ5ypMa2PDMXJH1oEcRzLem+KKrCGmW87RTA28CQ9 YtIm9ypivQ1h6U/Am0COkw671//xAL+t5SkrsASsdq69FbPK8vKCOSTkLwDp0/BRY7VK cg17np8UFgjktnVHYOFd86uSxn4M3FXsJ2h3bvuZT+RMlTwCiBrx0XeizTMrPSSZHhn9 QurEW3UYYEP+/btFVA+fUSQwO2jhE2tAVOu8BIyRsibgf1bQbWKVqhO69KMv+JTbAW79 0Qq/SW3OeK2z32oIwj6tqhIXVVMoHrStF5s53fuQkMsMOdzOf6ZA576Krjdu0gf5Ofjm jDkA== MIME-Version: 1.0 X-Received: by 10.42.157.68 with SMTP id c4mr1787272icx.35.1359499867810; Tue, 29 Jan 2013 14:51:07 -0800 (PST) Received: by 10.50.106.138 with HTTP; Tue, 29 Jan 2013 14:51:07 -0800 (PST) In-Reply-To: <1359498582.20362.YahooMailNeo@web133002.mail.ir2.yahoo.com> References: <1359498582.20362.YahooMailNeo@web133002.mail.ir2.yahoo.com> Date: Tue, 29 Jan 2013 23:51:07 +0100 Message-ID: To: hakre Cc: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=90e6ba613b32b16c3204d4753a94 Subject: Re: [PHP-DEV] echo new SplFileObject(__FILE__); From: tyra3l@gmail.com (Ferenc Kovacs) --90e6ba613b32b16c3204d4753a94 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Tue, Jan 29, 2013 at 11:29 PM, hakre wrote: > Can somebody shed some light why: > > > echo new SplFileObject(__FILE__); > > returns the first line of the file (in that case ` > SplFileInfo has the path and SplFileObject extends from it but it will > return the current line. I do not really understand why and I tend to > report this as a bug but I'm not sure. > > > --hakre > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > SplFileObject->__toString() is an alias for current() which will return the current line of file http://lxr.php.net/xref/PHP_5_3/ext/spl/spl_directory.c#2954 http://www.php.net/manual/en/splfileobject.tostring.php it seems that the class synopsis at http://www.php.net/manual/en/class.splfileobject.php is missing this method so it is easy to think that it isn't provided by the SplFileObject so the parent't method will be used, which isn't the case. --=20 Ferenc Kov=C3=A1cs @Tyr43l - http://tyrael.hu --90e6ba613b32b16c3204d4753a94--