Re: Pseudo-objects (methods on arrays, strings, etc.)

From: Date: Wed, 18 Jul 2012 07:31:14 +0000
Subject: Re: Pseudo-objects (methods on arrays, strings, etc.)
References: 1 2 3 4 5 6  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
hi!

On Tue, Jul 17, 2012 at 10:30 PM, Stas Malyshev <[email protected]> wrote:
> Hi!
>
>> Having pure object would be not efficient enough and brings its lot of
>> caveats. Also it is important to keep in mind that this idea does not
>> apply only to array but to other types as well.
>
> Same for other types. Just adding -> doesn't make the code
> object-oriented.

Not the point.

> And just bolting -> on top of regular function calls
> because it looks prettier seems meaningless to me. OK, we could make
> $foo->bar() mean bar($foo) - python already has pretty much the same
> idea, after all - but what's the point in it? I don't see any that would
> be worth the effort.

See the other answers, clear APIs, no more argument mess, cleanness.
Those are pretty good selling points and without any kind of BC.

Cheers,
-- 
Pierre

@pierrejoye | http://blog.thepimp.net | http://www.libgd.org


Thread (66 messages)

« previous php.internals (#61386) next »