I have some code similar to this:
QuercusEngine engine = new QuercusEngine();
Value value = engine.execute("<?php return $obj->getName(); ?>");
System.out.println(value);
(See http://wiki.caucho.com/Quercus:_Command_Line_Interface_(CLI) for more info)
I want to set $obj
as a java instance. Something like this:
SomeObject someObject = new SomeObject();
engine.setParam("obj", someObject);
Obviously this is a simplistic example but the point is that I want to be able to use instances of java classes that have already been instantiated in the php script. How could I do this?