jphp-group / jphp Goto Github PK
View Code? Open in Web Editor NEWJPHP - an implementation of PHP on Java VM
Home Page: http://jphp.develnext.org
License: Apache License 2.0
JPHP - an implementation of PHP on Java VM
Home Page: http://jphp.develnext.org
License: Apache License 2.0
[]$arr = 20; <--- incorrect expression, but for JPHP is valid!
Code:
<?php
class Foo {
public $parent;
public function __construct() {
}
public function bar() {
$this->parent = null;
}
}
Expected result:
nothing
Actual result:
$ ./jphp -f /var/www/jphp.php
[E_PARSE] Syntax error, unexpected '$this'
at line 11, position 3
in '/var/www/jphp.php'
at php.runtime.env.Environment.error(Environment.java:725)
at org.develnext.jphp.core.compiler.common.ASMExpression.unexpectedToken(ASMExpression.java:240)
at org.develnext.jphp.core.compiler.common.ASMExpression.<init>(ASMExpression.java:137)
at org.develnext.jphp.core.compiler.jvm.stetament.ExpressionStmtCompiler.writeExpression(ExpressionStmtCompiler.java:2649)
at org.develnext.jphp.core.compiler.jvm.stetament.ExpressionStmtCompiler.writeExpression(ExpressionStmtCompiler.java:2640)
at org.develnext.jphp.core.compiler.jvm.stetament.ExpressionStmtCompiler.compile(ExpressionStmtCompiler.java:2774)
at org.develnext.jphp.core.compiler.jvm.JvmCompiler.compileExpression(JvmCompiler.java:111)
at org.develnext.jphp.core.compiler.jvm.stetament.MethodStmtCompiler.compile(MethodStmtCompiler.java:489)
at org.develnext.jphp.core.compiler.jvm.JvmCompiler.compileMethod(JvmCompiler.java:103)
at org.develnext.jphp.core.compiler.jvm.stetament.ClassStmtCompiler.compile(ClassStmtCompiler.java:837)
at org.develnext.jphp.core.compiler.jvm.JvmCompiler.process(JvmCompiler.java:161)
at org.develnext.jphp.core.compiler.jvm.JvmCompiler.compile(JvmCompiler.java:189)
at php.runtime.env.Environment.importModule(Environment.java:905)
at org.develnext.jphp.cli.CLI.executeFile(CLI.java:56)
at org.develnext.jphp.cli.CLI.process(CLI.java:78)
at org.develnext.jphp.cli.CLI.main(CLI.java:87)
But, if rename field from parent
to blabla
or some other error doesn't happens.
This thing supports a lot of java embedded script engines. Will be
great if jPHP also support such interface.
https://jcp.org/en/jsr/detail?id=223
http://en.wikipedia.org/wiki/Scripting_for_the_Java_Platform
http://docs.oracle.com/javase/7/docs/technotes/guides/scripting/programmer_guide/
for example,
$n = 1 / 0; // no exception throw
$i++ and $i-- must return value and than increment/decrement.
Hello,
Is there a way to compile AjaxPlorer http://pyd.io/download/ into a jar using jphp ?
I tried to run the index.php using the jphp-cli:
C:\workdir\jphp-master\jphp-master\jphp-cli\build\libs\pydio-core-5.2.3>jphp.bat -f index.php
Exception in thread "main" php.runtime.launcher.LaunchException: Extension load error: class java.lang.ClassNotFoundException - bcmath
at php.runtime.launcher.Launcher.initExtensions(Launcher.java:158)
at php.runtime.launcher.Launcher.run(Launcher.java:182)
at org.develnext.jphp.cli.CLI.executeFile(CLI.java:48)
at org.develnext.jphp.cli.CLI.process(CLI.java:78)
at org.develnext.jphp.cli.CLI.main(CLI.java:87)
__destruct method need to use an envitorment object, but it not saved in objects.
Собственно проблема при сборке.
Делаю как написано в readme, получаю сразу ошибку:
http://pastebin.com/Z8JXR2EX
Пробовал уже достаточно вариантов - не получилось. Ругается как я понял на 13 строку конфига - единственное к чему там смог прицепиться ";" в конце строки, но убирание данного символа ни к чему не привело.
Что я делаю не так?
Code:
<?php
$arr = [1];
foreach ($arr as $i) {
echo $i, "\n";
$arr[] = ++$i;
}
Expected result (php 5.5):
$ php ./jphp.php
1
Actual result:
$ ./jphp -f /var/www/jphp.php
1
2
3
4
... asf ...
ReactiveViewModel
Improve dynamic local scope for variables, implement $$var and ${'name'} features.
Test
<?php
$a = 0x0f & ~0xf0;
echo $a === 15 ? 'success' : 'fail';
Expected result:
success
Actual result:
[E_PARSE] Syntax error, unexpected '&'
at line 3, position 8
in './test.php'
at php.runtime.env.Environment.error(Environment.java:719)
at php.runtime.env.Environment.error(Environment.java:711)
at org.develnext.jphp.core.syntax.generators.Generator.unexpectedToken(Generator.java:38)
at org.develnext.jphp.core.syntax.generators.manually.SimpleExprGenerator.processSimpleToken(SimpleExprGenerator.java:625)
at org.develnext.jphp.core.syntax.generators.manually.SimpleExprGenerator.getToken(SimpleExprGenerator.java:1082)
at org.develnext.jphp.core.syntax.generators.manually.SimpleExprGenerator.getToken(SimpleExprGenerator.java:890)
at org.develnext.jphp.core.syntax.generators.ExprGenerator.processSimpleExpr(ExprGenerator.java:477)
at org.develnext.jphp.core.syntax.generators.ExprGenerator.getToken(ExprGenerator.java:612)
at org.develnext.jphp.core.syntax.generators.ExprGenerator.getToken(ExprGenerator.java:643)
at org.develnext.jphp.core.syntax.generators.ExprGenerator.getToken(ExprGenerator.java:22)
at org.develnext.jphp.core.syntax.SyntaxAnalyzer.generateToken(SyntaxAnalyzer.java:284)
at org.develnext.jphp.core.syntax.SyntaxAnalyzer.processNext(SyntaxAnalyzer.java:224)
at org.develnext.jphp.core.syntax.SyntaxAnalyzer.process(SyntaxAnalyzer.java:202)
at org.develnext.jphp.core.syntax.SyntaxAnalyzer.process(SyntaxAnalyzer.java:187)
at org.develnext.jphp.core.syntax.SyntaxAnalyzer.<init>(SyntaxAnalyzer.java:115)
at org.develnext.jphp.core.syntax.SyntaxAnalyzer.<init>(SyntaxAnalyzer.java:49)
at org.develnext.jphp.core.compiler.jvm.JvmCompiler.<init>(JvmCompiler.java:34)
at php.runtime.env.Environment.importModule(Environment.java:898)
at org.develnext.jphp.cli.CLI.executeFile(CLI.java:56)
at org.develnext.jphp.cli.CLI.process(CLI.java:78)
at org.develnext.jphp.cli.CLI.main(CLI.java:87)%
Move:
Don't move:
Name the subproject as jphp-zend
... from http://ru2.php.net/manual/en/ref.filesystem.php
List of unimplemented functions:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.