Live data from Hacker News

PHP 7 Released

github.com

21–30 of 317 posts

Re: PHP 7 Released

#21
post #7

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/ http://php.net/manual/en/migration70.removed-exts-sapis.php 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 an…

I think it's great to point new developers to the right resources. Besides sane frameworks, there are some good starting/best practices guides to help (that are regularly updated), such as:

http://www.phptherightway.com https://phpbestpractices.org

Also, I would encourage them to look at different frameworks, not just one. It'll help if they later move onto other languages, as they'll be already exposed to different ways of doing things :)

Re: PHP 7 Released

#22
The scalar and return types are really a great improvement IMHO, I can't wait for Doctrine to fully support it for code generation.

But one thing which is missing is the nullable types, as currently it's either you always return a string and you can use scalar typing, or you sometimes return null and you can't use it (which I'm okay with)

https://wiki.php.net/rfc/nullable_types https://github.com/php/php-src/pull/1045

With this, it will permit to have even better static analysis "a la" HHVM/hack (i.e detecting that you haven't check for is_null in your code

Re: PHP 7 Released

#24

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.

And every php developer would wish that suddenly all php in the world upgrades to v7. We are years away from 7 having a big penetration in the ecosystem. And years more till it hits enterprise.

The performance improvements along with the support policy should hopefully encourage many sites to move to PHP 7 within a year; PHP 5.6 will be unsupported in 8 months (though it will receive security fixes for another year).

Re: PHP 7 Released

#25

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.

PHP is very likely to be the language used by Mort: http://blog.codinghorror.com/mort-elvis-einstein-and-you/

I doubt any of those developers are ever going to switch what they're already using unless they are forced by some external factor.

The more serious factor is: if you're on Hackernews, you're at least Elvis or even Einstein. Mort is out of reach for most internet media for programmers.

Re: PHP 7 Released

#26
post #20

As a person with more of an ops background can someone explain to me why / 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't have experienced programming skills, it feels like designers have now shifted to using Node for this?

It depends on whats being hosted. If you're dealing with legacy apps that were built in the PHP 5.2 or even PHP 4 days, be afraid. Be very afraid.

If you're dealing with more mainstream PHP apps like WordPress or Magento, its important to stay up on the core updates but also monitor the plugins and templates being installed. The majority of the attack surface on those apps is in the plugins because they're almost never audited.

As for modern customer apps, written in frameworks like Laravel or Symfony, you're usually fine. Those frameworks are on par with Django and Rails in being very hard to shoot yourself with.

Re: PHP 7 Released

#27
post #11
post #6

Earlier quoted context omitted.

No, PHP isn't "quite decent". It's still a steaming turd, it's just been polished with a whole bunch of features.

Please explain why.

Have you ever worked with php? I have only slightly and it was truly horrible. The library is a complete rubbish. You couldn't create worse one if you tried.

The language development is bad. Some developers are bad. Many users are bad. Does these points make the language bad? Yes. New features are incoherent and seemingly random, issues pop in and out (and back in) because tests simply fail, there are unexplainable security issues, documentation is bad, and if you look for any help (documentation comments, stackoverflow) you meet the users and their shitty tips.

Response to every criticism is "you just need to learn something". Does that make a good language? No. It's precisely what makes it bad.

PS: There's a nice subreddit for fun and laughs /r/lolphp - there are continuously new things as the language evolves, so the shittiness is not going away

Re: PHP 7 Released

#28

Earlier quoted context omitted.

And every php developer would wish that suddenly all php in the world upgrades to v7. We are years away from 7 having a big penetration in the ecosystem. And years more till it hits enterprise.

The performance improvements along with the support policy should hopefully encourage many sites to move to PHP 7 within a year; PHP 5.6 will be unsupported in 8 months (though it will receive security fixes for another year).

If you want to keep your sanity, don't ask the question how much of the web (even worse intraweb) is driven by php 4, 5.1 and 5.2.

Re: PHP 7 Released

#30
post #21
post #7

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/ http://php.net/manual/en/migration70.removed-exts-sapis.php 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 an…

I think it's great to point new developers to the right resources. Besides sane frameworks, there are some good starting/best practices guides to help (that are regularly updated), such as: http://www.phptherightway.com https://phpbestpractices.org Also, I would encourage them to look at different frameworks, not just one. It'll help if they later move onto other languages, as they'll be already exposed to different…

Is phptherightway up to date?

I only ask as scanning it I see that it recommends IIS7 for production PHP on windows servers. Which I believe you could only get using an unpatched windows 2008 server?

Post reply on HN