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

From: Date: Fri, 20 Jul 2012 07:44:39 +0000
Subject: Re: Pseudo-objects (methods on arrays, strings, etc.)
References: 1 2 3 4 5  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
As you suggested initially.  Don't make them objects.  You can leave them
scalars and still give them methods all from an extension.  Not via typical
APIs, granted, but the engine hooks are all in there.

On Thu, Jul 19, 2012 at 4:38 PM, Andrew Faulds <[email protected]>wrote:

> I'm curious, how do I make my objects have scalar passing semantics, then?
> On Jul 20, 2012 12:35 AM, "Sara Golemon" <[email protected]> wrote:
>
>>
>>
>> On Thu, Jul 19, 2012 at 2:42 PM, Andrew Faulds <[email protected]>wrote:
>>
>>> I never said treat them as objects. I said give them methods. Not the
>>> same thing.
>>>
>> Fair enough, noone is talking about giving them properties or formal
>> class definitions.
>>
>>> And what do you mean by "technical debt"?
>>>
>> I mean that we'll never escape the functional side of PHP, nor should we
>> try to.  So we're not talking about replacing a set of APIs, we're talking
>> about duplicating APIs which already exist.  More than that, we're talking
>> about creating a whole new branch of primitive handling in order to give
>> them methods without actually giving them class methods.  I'm not saying
>> that any of this is difficult to do, I'm asking if it actually gains us
>> anything which justifies doubling the number of implementations which deal
>> with string, array, and scalar operation.
>>
>> Given that you can accomplish this with a PECL extension, my answer is
>> "No, it doesn't."
>>
>> -Sara
>>
>


Thread (66 messages)

« previous php.internals (#61542) next »