Re: echo new SplFileObject(__FILE__);

From: Date: Wed, 30 Jan 2013 18:48:14 +0000
Subject: Re: echo new SplFileObject(__FILE__);
References: 1 2 3 4 5 6  Groups: php.internals 
Request: Send a blank email to internals+get-65518@lists.php.net to get a copy of this message
I also agree that we don't need to fix this, nor break BC. It is confusing as hell but it's there now and changing it would be more disruptive. Is there a desire from anyone to gracefully throw E_DEPRECATED in a future version of PHP 5.x when someone tries to __toString() the SplFileObject but only get back a single line ? That's the only "plan forward" I can see feasible if we decided to do anything, otherwise we should move on. On Wed, Jan 30, 2013 at 6:44 PM, Ferenc Kovacs <tyra3l@gmail.com> wrote: > 2013.01.30. 19:16, "Stas Malyshev" <smalyshev@sugarcrm.com> ezt írta: > > > > Hi! > > > > > 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. > > > > I don't see why it would be more sensible. It's different objects that > > do different things - Info represents file name, more or less, while > > Object represents file contents. I see no reason why it would only make > > sense for Object to return filename, or why we should "fix" something > > that is not broken. > > imo the toString should return something which represents the object and > the filename satisfy that better than a "random" line from the file. > but I agree that this isn't a real concern and doesn't need fixing. > > > -- > > Stanislav Malyshev, Software Architect > > SugarCRM: http://www.sugarcrm.com/ > > (408)454-6900 ext. 227 >

« previous php.internals (#65518) next »