PHP as an embedded scripting language

I got Lua scripts in C # working through LuaInterface and javascript scripts working through JInt. The goal is to support a wide range of scripting language options. Is there a similar method for running inline PHP scripts in a similar way?

IE, have a PHP script in the line, pass it either to the PHP command line, or to the sort interpreter, and capture the output (ideally, you can connect to .NET methods).

I looked at IronPHP, but it seems he hasn’t gone anywhere. He also looked at Falanger, but was not sure if he could do it. It looks like it's more like "Compiling PHP-.NET bytecode."

+3
source share
1 answer

I have never heard that someone embeds PHP in an application and thus exposes the internal methods for scripting. Lua is designed for this use case, just like Tcl, and JavaScript also has traction. I would recommend abandoning PHP, since the required effort is probably not worth it. Python will be a good language to try next.

+2
source

Source: https://habr.com/ru/post/1767924/


All Articles