在Visual C ++中创建一个简单的PHP解释器

When I look through the source code files I have downloaded from the PHP website, I get lost so easy. What I would like to do is obtain all the source code needed to create a Console application that takes your PHP code and executes it. I would also like to maybe be able to add C++ functions and calll them from PHP. I have done this quite simply with Lua on my Mac via Xcode, but I don't think it will be that easy using PHP on a different system using a different program.

You can write PHP extensions using C (or C++, I suppose) to expose libraries to PHP, but PHP isn't designed to be embedded in applications other than web servers.

Little 2019 update about @duskwuff comment.

PHP8 will have JIT compiler, so, no, PHP will no longer be used only for web.

Description

As you can see on image, PHP8 compiler is faster than Java, C compiler etc.