Hello Bob,

Friday, November 4, 2005, 11:19:23 AM, you wrote:

> Hi Marcus,

> OK, I got my learning cap on, why is it the wrong way to call cast_object? I
> just copied it from the example for a string param and it worked so I am
> curious why it is wrong. I agree the convert_to_* functions are a better
> solution for the reasons you mentioned, again, I just followed the example
> for the string case.

> I guess I don't see what this modification has to do with the future of PHP
> though. Why restrict the parameter API to objects that can only convert to a
> string value? I'd say the current behavior is almost worthy of a bug.

[...]

> In regards to the extension, I have the base objects complete: ZArray,
> ZChar, ZBoolean, ZDouble, ZInt, ZString. They all work interchangeably (for
> the most part) with their PHP native counterparts as long as you aren't
> using them on the left side of an expression.

And that is where get/set handlers come into play and why calling cat
handler alone is incorrect. Apart from that the 5 api has the parameter
should_free which should be non null if read and write zval are the same
so that the handler knows it must call zval_dtor on the readval prior to
assigning the new value. Since this interface is borked it has changed
in head. There read and write zval must be different and the caller has
to take care about any required free/destruction. That you had a look
into the stuff and haven't come accross this is again proof that the
old api was not only bork but also used wrong.

Best regards,
 Marcus

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to