Are you able to use this online java to php converter to convert the whole encog-java-core project to PHP so I can use the encog ML library in PHP ?
The java source is here: //github.com/jeffheaton/encog-java-core/archive/refs/tags/v3.3.zip
I tried this but it errors out: //github.com/bafolts/java2php
This lady was working on it but abandoned it in 2015: //github.com/katrinaniolet/encog-php-core
Thanks, this would be really helpful, since none of the PHP ML libraries allow multidimensional array data for training, but Encog does if the library can be ported to PHP.
syntax highlight
time limit: 5s 15s
What is Ideone?
Ideone is an online compiler and debugging tool which allows you to compile source code and execute it online in more than 60 programming languages.
How to use Ideone?
Choose a programming language, enter the source code with optional input data... and you are ready to go!
Having problems?
Check the samples to see how to write code which works correctly.To find out more visit our FAQ section.
Sphere Engine™
We are proud to present our Sphere Engine™ technology, which allows you to execute programs on a remote serverin a secure way within a complete runtime environment. Visit the Sphere Engine™ website to find out more.
Follow us
Is there are tools for converting java code to php? I have source code of java library and I need it to convert to php.
asked May 19, 2011 at 10:06
3
It is possible to automatically convert it. This is called a source to source compiler. Normally when you compile software, the parser will build an abstract syntax tree and convert this into the target machine language code. But it is just as possible to have a compiler convert this into another high level [compilable] language.
Java is a strongly typed language, and PHP is not, so source to source compilers are rare and the code conversion process is incomplete. However this said, there is a reasonably good one with a free demo at: //javatophp.com
answered Jun 27, 2013 at 2:52
AnonAnon
1191 silver badge3 bronze badges
5
Automatically - No. Now. Maybe in future. Don't spend time, write new code bro.
answered May 19, 2011 at 10:10
DanzanDanzan
9585 silver badges8 bronze badges
1
I don't think there is a solution like this currently.
You might try using a php-java bridge that would allow you to call the java code from within PHP: //php-java-bridge.sourceforge.net/pjb/
Zend Server also provides a bridge
answered May 19, 2011 at 10:13
jopkejopke
1,1886 silver badges18 bronze badges
Team of 5 folks at Facebook have spent 18 month to write sofrware that converts PHP to C++ [meet: HipHop]. There is no such software for transforming from Java to PHP yet.
The answer is: yes... it is possible if you have year and a half and team of pro programmers :] Otherwise, you rewrite it manually [I think, this is your choise].
answered May 19, 2011 at 10:08
NemodenNemoden
8,5166 gold badges38 silver badges65 bronze badges
There are lots of aspects of Java that cannot be expressed in PHP. Type safety for one. This sounds like a fool's errand to me. If you were looking to go in the opposite direction the question might have some interest.
answered May 19, 2011 at 10:47
8