polarphp
project?With the strong rise of Go
and NodeJS
, the market share of PHP
has gradually been eroded, and the PHP
official still sticks to the Web programming field. The more things you want to keep, the more you can't keep it. polarphp
draws on the related features of NodeJS
and Go
to repackage zendVM
, remove some of the old deprecated features and strong Web
attributes of PHP
, by implementing a new set of runtime framework libpdk
, the PHP
language is built into a true universal scripting language, empower PHP
, let it have asynchronous programming, coroutine, thread, built-in unicode
support, standard file IO
and so on. So that the PHP
programmer can not only do the web
application, but also face the real server application. polarphp
is not a new language, but a new compiler with runtime for the PHP
language.
PHP
language standard, removing obsolete language featuresDue to limited development resources, the development plan is tentatively scheduled as follows:
zend VM
with cmake
to generate polarphp
custom version of PHP
language virtual machinelit
test framework for LLVM
projectpolarphp
driver to implement PHP
code from the command linepolarphp
virtual machine, tentatively running the language virtual machine related regression test of PHP
polarphp
docker
image of the core virtual machinelibpdk
runtime frameworkpolarphp
in a minimum of stepscurrent we just test at macOS platform and you need run system in docker system.
git clone https://github.com/polarphp/polarphp.git
cd polarphp
git submodule init
git submodule update
git checkout v0.0.1-alpha
./devtools/scripts/build_polarphp.sh
At this time, the script starts compiling the relevant image, which takes a long time. Please wait patiently. Wait for the compilation to complete, you run:
docker images
At this time, please confirm that there is the following docker image in the output:
If there are no problems, we start testing whether polarphp is working properly in docker image.
docker run --rm -it polarphp_debug
After entering the container, enter our polarphp command line program:
polar --version
If you get the following output:
polarphp 0.0.1-git (built: 2019-01-27 12:22)
Copyright (c) 2016-2018 The polarphp foundation (https://polar.foundation)
Zend Engine v3.3.0-dev, Copyright (c) 1998-2018 Zend Technologies
Congratulations, you have successfully compiled the polarphp runtime environment. When compiling the image, we put a test script in the ~/temp/ folder.
if (function_exists('\php\retrieve_version_str')) {
echo "version str: " . \php\retrieve_version_str() . "\n";
}
if (function_exists('\php\retrieve_major_version')) {
echo "major version: " . \php\retrieve_major_version() . "\n";
}
if (function_exists('\php\retrieve_minor_version')) {
echo "minor version: " . \php\retrieve_minor_version() . "\n";
}
if (function_exists('\php\retrieve_patch_version')) {
echo "patch version: " . \php\retrieve_patch_version() . "\n";
}
You can run the following command:
polar ~/temp/main.php
If there are no errors, you will get the following output:
version str: polarphp 0.0.1-git
major version: 0
minor version: 0
patch version: 1
Thank you for testing polarphp, what is the problem, you can put it in the github issue list
At present, we only target Chinese users for the time being, so we use the communication method of WeChat and QQ
group. The following is the QR code. Interested students can scan the code to join:
PS:Please indicate the scan code, for example: learn
polarphp
orPHP
enthusiasts
polarphp
is redeveloped on top of the php
language project, following the agreement of the php
project. For details, please see: Project Agreement
===========================
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。