Live data from Hacker News

Upcoming changes in PHP 7.1

dotdev.co

131–137 of 137 posts

Re: Upcoming changes in PHP 7.1

#131

I haven't touched PHP in a long time, but the later releases makes me want to try it for a couple of small projects. Is there any good introduction for people how "know" PHP4 and want to get started with PHP7, using best practises?

I don't know PHP 7 yet, but I'd say there's plenty to learn just in PHP 5 if you haven't kept up since PHP 4. Perhaps a piecewise approach would be best, starting with the 'proper' C++/Java-esque version of OOP that I'd say is the biggest feature of PHP 5...

Re: Upcoming changes in PHP 7.1

#132

Earlier quoted context omitted.

> It is a stupid, stupid piece of crap. You haven't convinced anyone for either your eloquence or your argumentative skills. All your comments in this post, furthermore, suggest a teenager or close. Not to be ageist, but "stupid piece of crap", "shittier community", "drama loving, infantile minds" show neither deep thinking on the subject nor much maturity.

>you haven't convinced anyone for either your eloquence or your argumentative skills. Even in this thread, https://www.reddit.com/r/PHP/comments/41bm7j/new_rfc_allow_s... even when the language shows its true color in front of their very own eyes, people continue to be in denial. (See arguments of /u/betterphpguy). I don't bother to polish my arguments regarding this, because I know how futile it really is. A program…

We've banned these accounts for repeatedly breaking the HN guidelines.

Re: Upcoming changes in PHP 7.1

#133
post #83

Can we please change the link to the original article ( https://dotdev.co/upcoming-changes-in-php-7-1-76ebea53b820#.... ) "Learning Laravel" is a known plagiarist, who has a habit of ripping off content from other Laravel sites.

Ok, we changed the URL to that from http://learninglaravel.net/upcoming-changes-in-php-71. Thanks.

Re: Upcoming changes in PHP 7.1

#134
post #5

Earlier quoted context omitted.

I don't know if you can classify it as "good" concurrent programming but there's this https://github.com/krakjoe/pthreads EDIT "pthreads v3 is restricted to operating in CLI only" - from the project page.

This one does look promising. I didn't know they re-written it for PHP7. But still looks like an early days. Might wait a bit!

If I were you I'd explore a language that goes beyond those low level concurrency constructs because they can be extremely tricky to get right. Clojure and Elixir would be my top choices and the final choice depends on the kind of system you're trying to build.

Re: Upcoming changes in PHP 7.1

#135
post #121

Deprecating mcrypt this way is clearly a mistake regardless of how ineffective it is as an extension or how unmaintained it is. Almost every framework I've seen makes use of it. In almost 9 years, it was not communicated to the community at all that this was based on unmaintained, buggy code, and now they just want to yank it in a minor upgrade? WTF? At the very least, there should be collaboration with people who ma…

The release process specifically allows an extension to be deprecated and then punted to PECL.

As for frameworks, I and others have already been going around (for years before the mcrypt deprecation came up) switching things to use OpenSSL (and, for that matter, authenticated encryption) instead of mcrypt.

https://paragonie.com/blog/2015/05/if-you-re-typing-word-mcr...

To date: ZF, CodeIgniter, Symfony, Laravel, and CakePHP all support OpenSSL instead of Mcrypt, as do many, many more.

You get E_DEPRECATED in 7.1 then in 7.2 you can still

    pecl install mcrypt
...if you really have a need to support abandonware.

Re: Upcoming changes in PHP 7.1

#136

I'm more excited by some features not detailed in the article. Return type declarations, which were introduced in PHP 7.0, are being enhanced somewhat. First, it's now possible to declare nullable return types (previously all return types did not permit null): public function getFoo(): ?int; (You can also use ? on parameter and property types.) Second, we now have a void return type for functions where there is no us…

What is the reasoning for type hinting void when the PHP manual specifies that a NULL value is returned if the return is omitted? http://php.net/manual/en/functions.returning-values.php

You want to be able to communicate intent to clients of the function, especially with static tooling to check for common errors. For example:

https://github.com/facebook/hhvm/blob/HHVM-3.13/hphp/hack/te...

... has an obvious code smell detectable statically:

https://github.com/facebook/hhvm/blob/HHVM-3.13/hphp/hack/te...

Re: Upcoming changes in PHP 7.1

#137

Earlier quoted context omitted.

Depending on how far back you have to support (e.g., WordPress is still supporting 5.2), omission of the middle part wasn't supported until PHP 5.3.

5.3 came out seven years ago and isn't even officially supported by the PHP project now, let alone 5.2.

I know all too well, and you'd never catch me running that on any of my own systems. With a large enough install base, it's not uncommon to have a decent number of people on those older versions though.
Post reply on HN