Closed nabice closed 2 months ago
My test code:
import org.eclipse.php.core.PHPVersion;
import org.eclipse.php.core.ast.nodes.*;
public class Test {
public static void main(String[] args) {
String str = "<?php\n $a & $b;?> ";
try{
ASTParser parser = ASTParser.newParser(PHPVersion.PHP8_3, false, false);
parser.setSource(str.toCharArray());
AST ast = parser.createAST(null).getAST();
System.out.println(ast);
} catch (Throwable e) {
}
}
}
Output: Syntax error at character 10 of input
PHP8_0 is OK.
Sample Code:
return an
ASTError
Node.