TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

PH7 – An Embedded Implementation of PHP (C Library)

69 pointsby symisc_develover 11 years ago

12 comments

munificentover 11 years ago
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 未加载
Toucheover 11 years ago
&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 未加载
kodablahover 11 years ago
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>
frikover 11 years ago
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 未加载
FigBugover 11 years ago
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 未加载
captainmuonover 11 years ago
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 未加载
jacob019over 11 years ago
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 未加载
zalthorover 11 years ago
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 未加载
ausjkeover 11 years ago
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?
angersockover 11 years ago
Erm...how would people feel about having this as an available module for Node.js?<p>No reason. ;)
评论 #7267422 未加载
rlidwkaover 11 years ago
62022 lines of code in a single file... is that a joke? :)
elwellover 11 years ago
Pretty cool, but why&#x27;s it all in one .c file?