|
From: <php...@li...> - 2007-05-25 14:17:22
|
I've isolated the problem a bit more.
This works properly:
$string =3D new Java('java.lang.String', 'abc');
// prints 'abc'
echo $string;
These echoes, however, do not:
$string =3D new Java('java.lang.String', 'abc');
echo "This is my $string" . "\n";
echo "This is my " . $string . "\n";
echo $string " is my string" . "\n";
The result I see is:
This is my Object id #30
This is my Object id #30
Object id #30 is my string
The result is similar with other object types. Echoing just a boolean
object gives [[o:Boolean]:"true"], but concatenating it with a string
gives "Object id #1 is my boolean".
Thanks for your help,
Jonathan
System Details:
Java Bridge 4.0.7
Apache/2.0.55 (Win32)
PHP/5.1.6
=20
> -----Original Message-----
> From: php...@li...=20
> [mailto:php...@li...]=20
> On Behalf Of php...@li...
> Sent: Wednesday, May 23, 2007 4:54 AM
> To: php...@li...
> Subject: Re: [Php-java-bridge-users] java_values?
>=20
> Hi Jonathan,
>=20
> how does the code look like?=20
>=20
> Why is the cast necessary, anyway? The zend engine
> automatically converts a Java object into a PHP
> object.
>=20
>=20
> Regards,
> Jost Boekemeier
>=20
>=20
|