|
From: <php...@li...> - 2009-07-14 13:01:57
|
>> So why the sudden infinite loop bug? > > In PHP5 object->value autoconversion only works for strings, but not > for > other primitive values. Until the proposed hook exists, please use a > string > cast explicitly or java_is_false(), which calls ((bool)(string)$jobj) > internally. > > This feature was working in PHP4 (through a low-level api), dropped > in PHP5. > But I am quite sure this will work again in PHP6. 1. What is object->value autoconversion? Do you mean duck typing from $obj to typed values? 2. What proposed hook? 3. We've used this on PHP5 the entire time. >> took me and someone else about 10-12 hours of > > I m sorry for the inconvenience, but we've had the entire 4.x > release for > more than 2 years to help the transition from binary to XML. -- The > reason > was that the low level binary code doesn't work well in mixed > environments > (64 bit JVM vs. 32 bit PHP and vice versa), and needed recompilation > for > each new PHP binary. Our use of the bridge has been running perfectly for 2 years and we just haven't had to touch it. I was unaware of the "major internal infrastructure change" from 3.x to 4.x and didn't see any docs or upgrade guides to inform me. >> Simply adding the JAVA_PREFER_VALES=true fixed the > > We will switch it on as soon as possible. But what does it *do*? I've looked through the Java.inc code but it's just not obvious what this actually does. Would you recommend that I upgrade my code that uses the bridge to work *without* this setting? Does it confer any advantages? Is there a simple guide somewhere that explains what you have to understand about the bridge to make things work in PHP? I have scoured the web site but frankly I just don't see clear instructions on the best practices for using the bridge. Should I just *cast* everything? Only when the expected value is *not* a string? When should you use java_values vs not? I finally see some information regarding this in the Client API docs, but API docs aren't really good for getting started. I'd think it'd be useful to have a small 1-page "client user guide" with a handful of best practices for all of the requisite type-juggling which isn't at all an *expected* thing to need to do. Please understand that these criticisms come from love. The bridge is an amazing piece of software. It's run flawlessly for 2-3 years for us. But every time I use it I find it really confusing to try to get running and I feel that a small "guide" from the developers would save me (and other users) *tons* of time and frustration. I would write it myself for the project but at this point it'd just be terribly wrong! Regards, Alan |