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

From: Date: Thu, 19 Jul 2012 07:25:16 +0000
Subject: Re: Pseudo-objects (methods on arrays, strings, etc.)
References: 1 2 3 4 5 6 7 8 9 10  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
hi Rasmus,

On Wed, Jul 18, 2012 at 8:49 PM, Rasmus Lerdorf <[email protected]> wrote:

> This makes no sense to me either. How does it let us clean the APIs? Can
> you give an example? I have one:
>
> $a = -5;
> $b = "-5";
>
> echo $a->abs();  // Outputs 5
> echo $b->abs();  // should still output 5
>
> What has been cleaned here over:
>
> echo abs($a);
> echo abs($b);

Heh, here is another example where it makes even less sense: time();

sigh.

More seriously... we are not talking about these APIs and I am sure
you know which one I refer to, like the string API and the like.

Cheers,
-- 
Pierre

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


Thread (66 messages)

« previous php.internals (#61459) next »