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 <ajf...@googlemail.com>wrote:

> I'm curious, how do I make my objects have scalar passing semantics, then?
> On Jul 20, 2012 12:35 AM, "Sara Golemon" <poll...@php.net> wrote:
>
>>
>>
>> On Thu, Jul 19, 2012 at 2:42 PM, Andrew Faulds <ajf...@googlemail.com>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
>>
>

Reply via email to