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 8.0.0 beta 2

77 pointsby julien_cover 4 years ago

9 comments

svnpennover 4 years ago
PHP is damn good in certain areas.<p>It is one of the best choices (if not the best choice) for rapid prototyping of a program. Its damn fast to similar alternatives (Python, Ruby, Dart, JavaScript), and the standard library is huge.<p>It does have footguns. I am not a fan of the loose typing, but you can take some steps to mitigate. You can do &quot;===&quot;, &quot;strict_types&quot; and type hinting for function input and output. It is similar to C in that the language itself doesnt really do much to stop you from writing bad code. Also the function naming is not consistent, and even function arguments are not consistent. However PHP 8 will help with that somewhat, as you can now do named arguments.<p>Also PHP has the best language documentation I have ever seen. I would prefer more examples, but its well above some other languages.
评论 #24237667 未加载
评论 #24237035 未加载
评论 #24236297 未加载
评论 #24240979 未加载
评论 #24238065 未加载
mrrsmover 4 years ago
PHP, since version 7.0, has been a much improved language since when many people started hating on it. They have been consistently moving the spec forward and making improvements. It&#x27;s not perfect, but no language really is after all. It is really nice just seeing issues that have been around for a long time being addressed and fixed.
评论 #24236200 未加载
yagodragonover 4 years ago
I think it is possible that PHP is still the best choice for web development in 2020.<p>I&#x27;m coming from an academic background and i was looking to learn a new backend language to create simple CRUD type, web applications. I already know c&#x2F;c++, java, js and some python but after research it seems that Rails, Laravel and Django are the best options for this kind of projects as javascript on the backend is still a mess. So i&#x27;ve made a little comparison between them to choose what to learn.<p>Rails: It might be the best full stack web development framework from what i&#x27;m gathering, but it&#x27;s declining fast and Ruby has a small market share outside the US.<p>Django: It&#x27;s been always the 2nd or 3rd best option. Django 3.0 is going async which looks great on paper but in reality it needs work. It doesn&#x27;t have a built-in asset pipeline for modern js development on the front-end. It needs plugins for basic stuff like social, api auth etc. Python has libraries for almost everything but the web is not always a first class citizen.<p>PHP: It is by far the most popular backend language. Libraries are tailored for web development and are probably well maintained because they are used by huge projects(wordpress, magento etc). For the same reason it won&#x27;t disappear any time soon because it handles most of the information on the web and also billions of dollars in online commerce. Symfony has the most contributors than any backend framework and Laravel is probably the easiest framework to create an MVP with. Developers love Laravel and the community is huge. PHP is also improving and adopting new language features with a more advanced type system.<p>So the real question is why shouldn&#x27;t someone learn PHP in 2020 ?
评论 #24267414 未加载
tambourine_manover 4 years ago
PHP is seeing a renascence and renewed interest similar to what happened with JavaScript a few decades ago.<p>A language that&#x27;s easy to make fun of but widely used is an attractive target for improvement.
评论 #24236106 未加载
评论 #24236161 未加载
评论 #24236169 未加载
评论 #24236410 未加载
toupeiraover 4 years ago
Article with an overview of the changes: <a href="https:&#x2F;&#x2F;stitcher.io&#x2F;blog&#x2F;new-in-php-8" rel="nofollow">https:&#x2F;&#x2F;stitcher.io&#x2F;blog&#x2F;new-in-php-8</a><p>Some highlights are union types, a JIT compiler, named arguments, annotations, and match expressions.<p>The approach to named arguments is interesting. It&#x27;s nice that you don&#x27;t have to change the signature of existing functions, but the downside seems to be that you can&#x27;t enforce the usage of named arguments on callers, as in other languages like Ruby and Python where keyword arguments need to be declared as such.<p><pre><code> function foo(string $a, string $b, ?string $c = null, ?string $d = null) { &#x2F;* … *&#x2F; } foo( b: &#x27;value b&#x27;, a: &#x27;value a&#x27;, d: &#x27;value d&#x27;, );</code></pre>
评论 #24237140 未加载
no_wizardover 4 years ago
If the JIT for PHP ever becomes good enough it solves the memory leak problems PHP to this day is still plagued with, that might be enough to convince me to use PHP again, possibly, for some workloads.<p>I can&#x27;t help but feel that PHPs popularity is mostly tied to Wordpress, and to a lesser extend Laravel (with Symfony coming in behind that).<p>Not really sure the rest of the ecosystem even matters, outside those core pieces. I&#x27;d love to see it fix alot of landstanding issues, and I love that the language has moved forward. I&#x27;ve worked with it professionally over the last few years in various places, and I don&#x27;t particularly dislike so called &quot;modern&quot; PHP, but its only really good at very specified problem domains (mostly, you have a website, need to display said website. I always had scaling problems for anything other than using it in the context of a template language or very straightfoward database access. Real time APIs? nope. Just couldn&#x27;t get it done, too much memory pressure)
评论 #24236245 未加载
评论 #24236312 未加载
brian_herman__over 4 years ago
Hopefully this will change Apple&#x27;s mind. <a href="https:&#x2F;&#x2F;twitter.com&#x2F;GrahamJCampbell&#x2F;status&#x2F;1295111982924861442" rel="nofollow">https:&#x2F;&#x2F;twitter.com&#x2F;GrahamJCampbell&#x2F;status&#x2F;12951119829248614...</a>
评论 #24243559 未加载
mcdramameanover 4 years ago
The best language is the one you can make money with or positively affect the world. Please grow up out of this old debate. You all sound like 3 year olds...
评论 #24238455 未加载
ausjkeover 4 years ago
I heard about PHP is really just used by wordpress and drupal to keep its popularity ranking these days, and new projects seldom adopt it based on google trends, is this true?<p>The new PHP7&#x2F;8 is certainly exciting, is it too late?
评论 #24236937 未加载