> Now a new question: During Friday's discussion on PHP's, ah, strengths
> and just prior to the "so, the benefit of PHP is that you can use some
> other language" comment, somebody suggested that it was possible to have
> a PHP script invoke methods on Java objects. Is that person on the list?
> Does anyone know how to do this? (Yes, I've checked what appears to be
> the correct FM.)
heh quite possible. Rather than using PHP to access another language,
it's to more efficiently tie in legacy systems into your online web
stuff, but that's a whole other argument.
Anyhoo, you need to have some sort of JVM installed and PHP compiled
with java object support. Check the README in ext/java.
Basically, you instantiate a reserved overloaded Java class called
'Java'. This is the same for COM support which uses 'COM'.

$system = new Java("java.lang.System");
printf("Java version %s\n", $system->getProperty("java.version"));

Cheers,
 Graeme


--
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://slug.org.au/lists/listinfo/slug

Reply via email to