Menu

[r735]: / trunk / php-java-bridge / tests.jsr223 / test / Script.java  Maximize  Restore  History

Download this file

21 lines (17 with data), 579 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
package test;
import java.io.IOException;
import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
import javax.script.ScriptException;
public class Script {
/**
* @param args
* @throws IOException
* @throws ScriptException
*/
public static void main(String[] args) throws IOException, ScriptException {
ScriptEngine eng = (new ScriptEngineManager()).getEngineByName("php");
System.out.println(eng.eval("<?php if(java_is_true(java_context()->call(java_closure()))) print('test okay'); ?>"));
eng.eval((String)null);
}
}