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.

PHP 7 Released

449 pointsby legierskiover 9 years ago

43 comments

trm42over 9 years ago
PHP 7 makes life a lot better for PHP devs in many ways but one awesome thing is it obsoletes bunch of out-of-date tutorials by finally removing the old Mysql extension \o&#x2F;<p><a href="http:&#x2F;&#x2F;php.net&#x2F;manual&#x2F;en&#x2F;migration70.removed-exts-sapis.php" rel="nofollow">http:&#x2F;&#x2F;php.net&#x2F;manual&#x2F;en&#x2F;migration70.removed-exts-sapis.php</a><p>I actually met a young aspiring web developer who still learned DB-access with mysql_* functions. I urged him to switch to a sane framework like Laravel. Oh boy he was happy in a month and learned bunch of best practices quickly.
评论 #10662620 未加载
评论 #10662748 未加载
评论 #10662378 未加载
评论 #10662487 未加载
评论 #10662595 未加载
评论 #10662350 未加载
评论 #10662346 未加载
评论 #10698553 未加载
评论 #10662601 未加载
评论 #10663276 未加载
评论 #10664045 未加载
评论 #10662750 未加载
评论 #10662910 未加载
Flimmover 9 years ago
PHP 7 new features: <a href="http:&#x2F;&#x2F;php.net&#x2F;manual&#x2F;en&#x2F;migration70.new-features.php" rel="nofollow">http:&#x2F;&#x2F;php.net&#x2F;manual&#x2F;en&#x2F;migration70.new-features.php</a>
ausjkeover 9 years ago
Been learning php on and off for a while, happy to see this release is out. Most likely I will use PHP for my future projects instead of the alternatives.<p>Languages are learning from each other these days, the new PHP definitely benefited from this trend and is actively evolving itself, which is the major reason I&#x27;m to stick with it.<p>Some PHP developers recommended nodejs over PHP for the future to me, after a few experience I feel PHP may be better for long-term maintenance. Renovation is good, it&#x27;s just that javascript may have too much of it for me to chew on nowadays.<p>Wish there will be a light-weight version of PHP, something like micropython or Lua, so I can use it on low-end systems when needed. PHP is still very demanding on resources comparing to other languages, even nodejs can be used on IoT devices with restricted mem&#x2F;cpu power.
egeozcanover 9 years ago
Why do they keep adding global functions like &quot;intdiv&quot;? For example in JS, it being another language with a similar compatibility burden, they are moving most of the global functions (like parseInt) to &quot;namespaces&quot; (like Number.parseInt) while keeping global references there. When I open the docs (for example, the array functions page[1]), I get frightened by the global functions which do not seem to share a naming convention on first glance.<p>disclaimer: I haven&#x27;t written anything significant with PHP since too many years.<p>[1]: <a href="http:&#x2F;&#x2F;php.net&#x2F;manual&#x2F;en&#x2F;ref.array.php" rel="nofollow">http:&#x2F;&#x2F;php.net&#x2F;manual&#x2F;en&#x2F;ref.array.php</a>
评论 #10662493 未加载
评论 #10662513 未加载
评论 #10663199 未加载
评论 #10663675 未加载
评论 #10663694 未加载
RohithMeethalover 9 years ago
I wish every PHP developer would reread the docs and start using new features available instead of just continuing with what they know already just because it works. And of course if there was any way to remove all those old tutorials out there.
评论 #10662349 未加载
评论 #10662392 未加载
longwaveover 9 years ago
The performance improvements in this release will hopefully encourage people to upgrade, even if the new features don&#x27;t. Common PHP applications run 70%-100% faster on PHP 7 than they did on PHP 5.6, comparable with or better than HHVM.
评论 #10662950 未加载
评论 #10662471 未加载
lsaferiteover 9 years ago
I was so excited when I saw this post. Then I realized it&#x27;s another &#x27;too early&#x27; post claiming the tag == release. It&#x27;s not released until it happens on the PHP site. This is just a tag in the repo. Sure, it likely won&#x27;t change now, but it could.
评论 #10663126 未加载
评论 #10662974 未加载
评论 #10663946 未加载
评论 #10663204 未加载
DigitalSeaover 9 years ago
Probably one of the biggest releases since 5 in my opinion. Scalar and return type declarations being added in are a couple of massive additions. For a language that used to cop a lot of flak, PHP sure has grown to become a mature and quite decent language.
评论 #10662247 未加载
评论 #10662275 未加载
allan_sover 9 years ago
The scalar and return types are really a great improvement IMHO, I can&#x27;t wait for Doctrine to fully support it for code generation.<p>But one thing which is missing is the nullable types, as currently it&#x27;s either you always return a string and you can use scalar typing, or you sometimes return null and you can&#x27;t use it (which I&#x27;m okay with)<p><a href="https:&#x2F;&#x2F;wiki.php.net&#x2F;rfc&#x2F;nullable_types" rel="nofollow">https:&#x2F;&#x2F;wiki.php.net&#x2F;rfc&#x2F;nullable_types</a> <a href="https:&#x2F;&#x2F;github.com&#x2F;php&#x2F;php-src&#x2F;pull&#x2F;1045" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;php&#x2F;php-src&#x2F;pull&#x2F;1045</a><p>With this, it will permit to have even better static analysis &quot;a la&quot; HHVM&#x2F;hack (i.e detecting that you haven&#x27;t check for is_null in your code
cdnsteveover 9 years ago
I&#x27;m actually excited for this release!<p>- Type declarations (this is a HUGE move forwards).<p>- Grouped use statements, not sure if I like how that looks<p>- ?? will shorten statements<p>- Anonymous classes seem a bit odd looking to me<p>- Unserialize filter is a nice security bump<p>Anxious to try it out and see the speed improvements I&#x27;ve been hearing about too.
评论 #10664058 未加载
datashovelover 9 years ago
The one thing I&#x27;d love to see is a native concurrency story with PHP. I&#x27;d put my vote in specifically to have Communicating Sequential Processes. I think that feature alone would take the language to another level. I know they&#x27;ve got stream_select, et al. and I&#x27;ve really enjoyed pecl event, reactphp, and of course there&#x27;s HackLang&#x27;s Async &#x2F; Await if you want to convert, but having some modern &#x2F; native constructs would be nice to have. Does anyone know if that&#x27;s on the horizon?
评论 #10663847 未加载
defenestrationover 9 years ago
Congratulations to the PHP community with this milestone!<p>I wonder if people who switched to HHVM, will start using PHP again. HHVM has offered much faster performance than previous versions of PHP. The speed of PHP 7 is at par with HHVM.
评论 #10662478 未加载
评论 #10662687 未加载
motiejusover 9 years ago
OK, great! Clicking the main page[1], see the top of README:<p>&quot;build error&quot;.<p>Wait, what? You just released it, it should definitely work! Clicking that icon[2], checking the failed build[3]:<p>ERROR: no certificate subject alternative name matches<p>requested host name `pear.php.net&#x27;.<p>To connect to pear.php.net insecurely, use `--no-check-certificate&#x27;.<p>Really? See what&#x27;s in <a href="http:&#x2F;&#x2F;pear.php.net&#x2F;" rel="nofollow">http:&#x2F;&#x2F;pear.php.net&#x2F;</a><p>&gt; The server running pear.php.net had a fatal hard disk failure and gets replaced by a new machine this week. Until the new machine is setup, this page is up to let you continue installing PEAR packages via the PEAR installer.<p>In 2015? Cool.<p>Connecting to the https website ...<p>% openssl s_client -connect pear.php.net:443 ... Certificate chain 0 s:&#x2F;CN=mail.cweiske.de<p>So you&#x27;re using CN=mail.cweiske.de for pear.php.net. I don&#x27;t even know what to say.. Well, happy hacking!<p>[1]: <a href="https:&#x2F;&#x2F;github.com&#x2F;php&#x2F;php-src" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;php&#x2F;php-src</a> [2]: <a href="https:&#x2F;&#x2F;travis-ci.org&#x2F;php&#x2F;php-src" rel="nofollow">https:&#x2F;&#x2F;travis-ci.org&#x2F;php&#x2F;php-src</a> [3]: <a href="https:&#x2F;&#x2F;travis-ci.org&#x2F;php&#x2F;php-src&#x2F;jobs&#x2F;94372493" rel="nofollow">https:&#x2F;&#x2F;travis-ci.org&#x2F;php&#x2F;php-src&#x2F;jobs&#x2F;94372493</a>
评论 #10663284 未加载
评论 #10663593 未加载
评论 #10677497 未加载
sarciszewskiover 9 years ago
The feature I&#x27;m most excited about is the availability of a simple, sane, and correct CSPRNG:<p><pre><code> string random_bytes(int $numBytes); int random_int(int $min, int $max); </code></pre> If you want to use this interface in a project that needs to be compatible with PHP 5, there&#x27;s always <a href="https:&#x2F;&#x2F;github.com&#x2F;paragonie&#x2F;random_compat" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;paragonie&#x2F;random_compat</a>
captn3m0over 9 years ago
Have been waiting for this anxiously. I&#x27;ve been running a few test builds on it occasionally, but its nice to have the guarantee to shift prod systems to it.<p>New Features list is at <a href="https:&#x2F;&#x2F;secure.php.net&#x2F;manual&#x2F;en&#x2F;migration70.new-features.php" rel="nofollow">https:&#x2F;&#x2F;secure.php.net&#x2F;manual&#x2F;en&#x2F;migration70.new-features.ph...</a><p>My favorite is scalar typehinting by far.
almsgiverover 9 years ago
A tag is not a release, it should be officially released tomorrow.
评论 #10662381 未加载
samuellover 9 years ago
To me, PHP is still interesting, because of the ProcessWire CMS&#x2F;CMF [1], which is basically the next best thing afte sliced bread (A generic hierarchical content structure, with a jquery-inspired PHP template API, giving FULL flexibility to customize your design and presentation to anything you like ... even REST apis are just a few lines of code in a template. Add to that dozens of dozens of extremely nicec features built in, such as automatic thumbnail resize through API methods such as &lt;img src=&quot;{$image-&gt;size(90,90)-&gt;url}&quot;&gt; ... and you have something immensely powerful).<p>[1] <a href="http:&#x2F;&#x2F;processwire.com" rel="nofollow">http:&#x2F;&#x2F;processwire.com</a>
cdnsteveover 9 years ago
Stuff like this hurts: <a href="https:&#x2F;&#x2F;www.drupal.org&#x2F;node&#x2F;2454439" rel="nofollow">https:&#x2F;&#x2F;www.drupal.org&#x2F;node&#x2F;2454439</a>
评论 #10662820 未加载
评论 #10662785 未加载
评论 #10663998 未加载
MrBraover 9 years ago
When years ago I started learning Ruby and wanted to use it for the web, my intention was using it like you do with PHP (simply including it in HTML) but I got a bit frustrated because all the resources I kept finding showed the only way of using Ruby in a web context was by using a big framework like Rails or, by choosing a wrong path and playing with stuff which required a lot more in depth knowledge that I did not have (and that I didn&#x27;t want to be forced to have because I just wanted to focus on app code and experiment).<p>I only recently discovered <a href="https:&#x2F;&#x2F;github.com&#x2F;migrs&#x2F;rack-server-pages" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;migrs&#x2F;rack-server-pages</a> which allows to simply shove Ruby in HTML the same way as PHP and as a new Ruby dev could expect to be able to do. I think this approach makes learning projects simpler, and at the same has the added value of making people actually learn a lot about those aspects of HTTP that frameworks keep well hidden under their carpet and that can help you become a good web developer instead of &quot;simply&quot; a framework user.<p>Yes for sure, best practices that frameworks implement are there for a reason, and it&#x27;s great to have them, but IMHO, this approach has advantages when learning and could also be seen as an essential step to understand what those frameworks you will use next are abstracting and why.<p>IMHO, what still contributes to new generations of devs approaching PHP, is also its immediateness and simplicity with nothing to do except &#x27;&lt;?php&#x27; code &#x27;?&gt;&#x27; and with this comment I just wanted to give a bit more exposure to the fact that a similar solution exists for Ruby too, and that it&#x27;s a bit of a pity that because of the importance of Rails it got a bit overshadowed.
jafingiover 9 years ago
It&#x27;s really a great release! Great work by all the contributors.
mei0Ieshover 9 years ago
Yay, null coalesce operator! That shortens a lot of common redundancy. When will there be a FreeBSD port?
drakonkaover 9 years ago
Congratulations and thank you to everybody who has contributed. I&#x27;ve been running PHP 7 for my hobby project for the last couple of months. The update was refreshingly painless and I&#x27;ve had zero compatibility troubles so far.
ck2over 9 years ago
PHP 7 literally cuts the load in half for PHP code which means hundreds of thousands of servers can either now save power or serve nearly twice the number of connections.<p>win-win<p>almost as fast as hhvm but much easier to adapt
jwdunneover 9 years ago
I&#x27;ve been anticipating this for a while. Some great additions, especially scalar type hinting and type hinting on return types. The ability to enable stricter typing via a directive is also great. It&#x27;s a shame internals voted down short-hand syntax for anonymous functions, including implicit closure over outer scope variables - a function with closures in PHP can get ugly very fast. Using higher-order functions becomes far more unwieldy.
mrmondoover 9 years ago
As a person with more of an ops background can someone explain to me why &#x2F; when PHP might be a viable language? My experience with hosting PHP apps has historicity been one of fending off security issues and I think that often in the past PHP was often a language for designers that didn&#x27;t have experienced programming skills, it feels like designers have now shifted to using Node for this?
评论 #10662439 未加载
评论 #10662455 未加载
评论 #10662396 未加载
评论 #10663580 未加载
oblioover 9 years ago
Can anyone closer to the subject provide some info about this: <a href="https:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;programming&#x2F;comments&#x2F;3v4l98&#x2F;php_7_released&#x2F;cxkazco" rel="nofollow">https:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;programming&#x2F;comments&#x2F;3v4l98&#x2F;php_7_r...</a>?<p>That comment looks a bit scary if it&#x27;s true :(
timmy_over 9 years ago
I use PHP for my freelance work mainly because I have no option on hosting. I never got the <i>appeal</i> for PHP (besides being cheap to host). All my personal projects are either done in Python or Node + (Angular, react &amp; now Vue)<p>Python: PURE elegance<p>Node: io breeze<p>PHP: ?<p>Q: is the &quot;module&quot; system still achieved by dumping file content or is there a linking system?
评论 #10666160 未加载
awalGargover 9 years ago
Great release! I think the BC breaks are all justified :)<p>And all the shared hosts around still stuck at 5.3 or so, this is your time to move forward. At least start <i>offering</i> a PHP7 version, if not a straightway upgrade.<p>Huge thanks to the internals for their hard work.
GigabyteCoinover 9 years ago
Are they skipping 6.X releases or something?<p>The latest release according to php.net [0] is 5.6.15 which come out October 29th of 2015.<p>[0] <a href="https:&#x2F;&#x2F;secure.php.net&#x2F;releases&#x2F;" rel="nofollow">https:&#x2F;&#x2F;secure.php.net&#x2F;releases&#x2F;</a>
评论 #10664665 未加载
adrianmacneilover 9 years ago
Given how dependent php is on hosts to upgrade, and how slow php hosts traditionally move, it would seem that php would benefit from a 7-to-5 transpiler, similar to Babel for JS. Does anything like this exist already?
评论 #10663865 未加载
sarciszewskiover 9 years ago
<a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=10672307" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=10672307</a>
sarciszewskiover 9 years ago
By the way, PHP 7 has been tagged but not yet released.
dutchbritover 9 years ago
Cool stuff, PHP 7 looks very promising, especially when it comes to speed. In some cases even faster than HHVM.
jpmwover 9 years ago
I left the PHP community years ago, but...but...where is PHP 6? What was the reason to skip it?
评论 #10664142 未加载
评论 #10664133 未加载
josuover 9 years ago
What effect will this have on Wordrpess?
评论 #10665410 未加载
darkhornover 9 years ago
It has not been released yet.
gustavofultonover 9 years ago
Is it the final release now?
jjuhlover 9 years ago
Why, ohh why, won&#x27;t this freak of nature (language) just die :-(
评论 #10664518 未加载
评论 #10664792 未加载
评论 #10664443 未加载
velmuover 9 years ago
Excellent!
razvan_moldovanover 9 years ago
yeeeeh :D great work
jimaekover 9 years ago
Cant wait for php-memcache and a few other extensions to support PHP7 to move our projects
评论 #10662515 未加载
debacleover 9 years ago
A very lost opportunity to create a new stdlib and eventually phase out the old, shitty, procedural one.
circaover 9 years ago
I haven&#x27;t worked with PHP in quite some time now but I am happy to see its still kicking. Although it does bring back some haunting memories from versions 3 and 4.