TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

PH7 – An Embedded Implementation of PHP (C Library)

69 点作者 symisc_devel超过 11 年前

12 条评论

munificent超过 11 年前
This seems like madness to me. It&#x27;s &quot;PHP&quot;, so it inherits everything that&#x27;s bad about that language. But it&#x27;s also incompatible with PHP, so you don&#x27;t even get the power of being able to reuse the world&#x27;s existing PHP code and expertise.<p><pre><code> * PH7 is case-sensitive unlike the standard PHP engine * Unlike the zend engine which passes arrays by copy, PH7 pass arrays by reference exactly like PHP5 does with objects (class instances). </code></pre> I&#x27;m not saying the extensions and changes they&#x27;ve made aren&#x27;t for the better, but they mean this language is effectively <i>not</i> PHP. And, if you&#x27;re going to use a language that&#x27;s not PHP, why not use one that&#x27;s significantly cleaner and simpler?
评论 #7265184 未加载
Touche超过 11 年前
&gt; gcc -W -Wall -O6 -o ph7_test ph7_intro.c ph7.c<p>Nice! I wish creating Lua executables were this easy. With Lua you have to create a wrapper C file, use squishy to combine multiple lua files into one, and finally a script to turn the lua script into a C byte array. I have a boilerplate project that I use so that I just have to run `make`, that avoids the need to ever touch C for the most part. But it would be nicer if luac and luajit did this automatically.
评论 #7264418 未加载
评论 #7264587 未加载
评论 #7264337 未加载
kodablah超过 11 年前
That is one big C file. Curious if you&#x27;ve ran against any of the Zend tests in the original implementation [1][2]. I do not see anything on <a href="http://ph7.symisc.net/" rel="nofollow">http:&#x2F;&#x2F;ph7.symisc.net&#x2F;</a>.<p>1 - <a href="https://github.com/php/php-src/tree/master/tests" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;php&#x2F;php-src&#x2F;tree&#x2F;master&#x2F;tests</a> 2 - <a href="https://github.com/php/php-src/tree/master/Zend/tests" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;php&#x2F;php-src&#x2F;tree&#x2F;master&#x2F;Zend&#x2F;tests</a>
frik超过 11 年前
The developer have also two other interesting projects on their website:<p>* jx9 - programming language based on JSON (like Lua with a JS syntax): <a href="http://jx9.symisc.net/" rel="nofollow">http:&#x2F;&#x2F;jx9.symisc.net&#x2F;</a><p>* unQLite - NoSQL database engine (like SQLite but NoSQL): <a href="http://unqlite.org/" rel="nofollow">http:&#x2F;&#x2F;unqlite.org&#x2F;</a>
评论 #7268057 未加载
FigBug超过 11 年前
I&#x27;ve been looking for something like this. Originally I had planned to do it with Python, but Python only seems to allow one interpreter at a time.<p>Does anybody know if it&#x27;s easy to make new functions available to PHP that would call into the C main program?<p>It says &quot;Built with more 470 function&quot; how does that compare with standard PHP? If I take some PHP I&#x27;ve previously written or a library, is it going to run with minor modifications? Or is this a subset of PHP?
评论 #7264582 未加载
captainmuon超过 11 年前
This is pretty cool. First I was wondering what for, but its great for their use case (embedded devices). Why not use a language for the web interface the developer is familiar with.<p>Unfortunately, they&#x27;re a bit late. Nowadays it would probably be cooler to use JS, if language popularity is the focus. Or maybe python.<p>(Aside: I learned web development in the good old LAMP times. My silly gut feeling is still that PHP is pretty fast and flexible compared to Python which seems slow (on the server), and JS which is way too slow and fragile. I know it&#x27;s completely backwards nowadays, but funny how what you&#x27;ve learned sticks. When I hear &quot;JS on a Arduino&quot; I always think &quot;yeah sure....&quot;, but it&#x27;s actually a clever idea, just like this.)
评论 #7265313 未加载
评论 #7265199 未加载
jacob019超过 11 年前
Normally I wouldn&#x27;t touch PHP due to the long history of security issues. Would this do anything to improve it? Love the idea of an embeddable interpreter.
评论 #7264783 未加载
评论 #7264761 未加载
评论 #7265244 未加载
评论 #7264787 未加载
zalthor超过 11 年前
Curious, what do people who work with embedded systems usually use to get a web interface for their device? Routers, for as long as I can remember have had a web UI though I&#x27;m not really sure what sort of a back end runs it.
评论 #7265401 未加载
评论 #7265381 未加载
评论 #7264725 未加载
评论 #7264977 未加载
评论 #7264928 未加载
ausjke超过 11 年前
For embedded device normally LUA is used, how does PH7 compare to LUA? as PHP&#x2F;LUA is normally used to provide web interface, how does PH7 do CGI?
angersock超过 11 年前
Erm...how would people feel about having this as an available module for Node.js?<p>No reason. ;)
评论 #7267422 未加载
rlidwka超过 11 年前
62022 lines of code in a single file... is that a joke? :)
elwell超过 11 年前
Pretty cool, but why&#x27;s it all in one .c file?