|
From: <php...@li...> - 2008-01-22 10:24:17
|
Hi,
> but nothing about why I should upgrade
the cache is now enabled. This means that the following code:
$s = new java("java.lang.StringBuffer");
for($i=0; $i<400000; $i++) $s->append ($i);
runs in less than 15 seconds. -- The bsh script engine runs the same test in ~18 seconds.
The old C code has been removed, as it is about 5 times slower than the pure Java solution.
On the other hand the current PHP versions (php 5.2.x) fail to run the following code properly:
class Clazz { function __toString() { return "1"; }
$obj = new Clazz ();
if ($obj == 1) ...
One must write the above code as:
if (((boolean)(string) $obj) == 1) ...
or
if (java_values ($obj) == 1) ...
I don't I'd consider the above limitation a bug.
In PHP version 4 it was possible to cast an object to a boolean value for example. And I don't see
a reason why this feature is not available in php version 5...
Regards,
Jost Boekemeier
__________________________________ Ihre erste Baustelle? Wissenswertes für Bastler und Hobby Handwerker. www.yahoo.de/clever
|