Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:65447 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 74580 invoked from network); 29 Jan 2013 23:00:31 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Jan 2013 23:00:31 -0000 Authentication-Results: pb1.pair.com smtp.mail=cspray.php@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=cspray.php@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.54 as permitted sender) X-PHP-List-Original-Sender: cspray.php@gmail.com X-Host-Fingerprint: 209.85.212.54 mail-vb0-f54.google.com Received: from [209.85.212.54] ([209.85.212.54:54632] helo=mail-vb0-f54.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 52/91-10721-E8458015 for ; Tue, 29 Jan 2013 18:00:30 -0500 Received: by mail-vb0-f54.google.com with SMTP id l1so646294vba.27 for ; Tue, 29 Jan 2013 15:00:27 -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=2qzWmNQ3vOCIYL3oKPBNMG2dpitBz52qFIa1DjtRr+s=; b=rXWfFqudBDil7YXrzBR7kBT0R0y4s++zosK0im/TRI/iatTBDfO/okvIYowJSf4Qr4 nYJh6DGUzvhLGzz9UokwLQgaMKBRzwtuWUlelnmkqGm7uuiwAHxI/MiprbXCk6m8v9vJ UJxcX80pZNB86aEidbVx4R3VlZCyElhcxd3ojpbPwpfP4Py+PRHbvzEKzIf+M1xr9z+b zIUDzJcyFLT1RqDkgTPAvSqrCnKvzqlruflB1+MgwEmT3GTqg8mkxzygH/zZKSXIzjO2 vk5ABRTHSOwKM8tJZeJdAEJRS+rxDPMo3TXOmQGuStie/LHhZx+jSZefDFKnGkgz+HP+ e6Kw== MIME-Version: 1.0 X-Received: by 10.220.157.72 with SMTP id a8mr2936542vcx.30.1359500427627; Tue, 29 Jan 2013 15:00:27 -0800 (PST) Received: by 10.58.229.162 with HTTP; Tue, 29 Jan 2013 15:00:27 -0800 (PST) In-Reply-To: References: <1359498582.20362.YahooMailNeo@web133002.mail.ir2.yahoo.com> Date: Tue, 29 Jan 2013 18:00:27 -0500 Message-ID: To: Ferenc Kovacs Cc: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=f46d043c7ea40f8cf804d4755c74 Subject: Re: [PHP-DEV] echo new SplFileObject(__FILE__); From: cspray.php@gmail.com (Charles PHP) --f46d043c7ea40f8cf804d4755c74 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable This feels like a bug to me. Why would SplFileObject::__toString return the current line while SplFileInfo::__toString returns file path? On Tue, Jan 29, 2013 at 5:51 PM, Ferenc Kovacs wrote: > 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 t= he > 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. > > -- > Ferenc Kov=E1cs > @Tyr43l - http://tyrael.hu > --f46d043c7ea40f8cf804d4755c74--