Live data from Hacker News

Upcoming changes in PHP 7.1

dotdev.co

71–80 of 137 posts

Re: Upcoming changes in PHP 7.1

#71
post #5

Off topic, but curious - Is there any discussion on whether there will be a support for a good concurrent programming in PHP in the future? (e.g. channels in Go & Elixir) - of course, you might say "you're using the wrong tool.."

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!

Re: Upcoming changes in PHP 7.1

#72
post #30

Earlier quoted context omitted.

Better yet, don't reinvent the world and just use commas?

Commas are used in PHP as a sequence of things, not multiple options. This single-pipe notation is already established as the further-up comments states.

> Commas are used in PHP as a sequence of things

Choosing a pipe because it's easier for an obscure language feature, is not least astonishment. Commas are used for lists. The pipe is a bad choice among a nice feature.

Re: Upcoming changes in PHP 7.1

#73
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?

Re: Upcoming changes in PHP 7.1

#74

Off topic, but curious - Is there any discussion on whether there will be a support for a good concurrent programming in PHP in the future? (e.g. channels in Go & Elixir) - of course, you might say "you're using the wrong tool.."

React has been around for a while - http://reactphp.org/

This is not really concurrency, though, it just makes PHP resemble NodeJS.

Re: Upcoming changes in PHP 7.1

#75

Earlier quoted context omitted.

I was talking more about the inconsistency between return type void when it returns null. I'm asking whether this behavior has changed and functions without a return will now return void or ???. It's a pretty big inconsistency IMHO.

Even if you have a point it wouldn't matter because making void functions return something else than null would be a big (useless) BC break. There's a lot of code that uses "return;" to mean "return null;" and honestly I don't see it as a big problem.

The point I was trying to make is that PHP does not have -- nor should it have, I think -- a concept of void. Functions without a return statement already return null. "return;" is already equivalent to "return null;" as well, as you pointed out. It would be more consistent to type-hint return null instead of introducing a new return type (void) into the language. I know PHPDoc already uses "@return void", and I have never liked it for the same reason. It is not a concept used anywhere else in PHP, AFAIK.

Re: Upcoming changes in PHP 7.1

#76
Don't use Php. Just don't.

It is a stupid, stupid piece of crap. It is very hard, even for people with more than 10 years of experience, to know all the potential gotchas that are hidden deep inside this death trap of a language [1]

You will be surprised how casual the actual core development of the language is. Tiny behaviours are added, modified and removed with little or no thought and with as little justification as "This doesn't make sense to me" or without any sort of notice at all [3]..

[2] Here is how Php 7 tries to "improve" security of a function...

And the community. Is there a more shittier community than that of this language? It is dominated by people with drama loving, infantile minds.

Keep as far as possible from this language, if you have to work with it, wear on a mental condom before you start and never involve in any kind of Php discussions.

[1] https://www.reddit.com/r/PHP/comments/41bm7j/new_rfc_allow_s...

[2] https://www.reddit.com/r/PHP/comments/3j88v4/something_about...

[3] http://stackoverflow.com/questions/14703363/why-is-the-stand...

Re: Upcoming changes in PHP 7.1

#77

Don't use Php. Just don't. It is a stupid, stupid piece of crap. It is very hard, even for people with more than 10 years of experience, to know all the potential gotchas that are hidden deep inside this death trap of a language [1] You will be surprised how casual the actual core development of the language is. Tiny behaviours are added, modified and removed with little or no thought and with as little justification…

PHP is a widely-used mature tool for website development. It can be used in good or bad ways by good or bad people. Nothing more, nothing less. No need for the fanatical absolutism.

Re: Upcoming changes in PHP 7.1

#78

Don't use Php. Just don't. It is a stupid, stupid piece of crap. It is very hard, even for people with more than 10 years of experience, to know all the potential gotchas that are hidden deep inside this death trap of a language [1] You will be surprised how casual the actual core development of the language is. Tiny behaviours are added, modified and removed with little or no thought and with as little justification…

PHP community is huge and you are generalizing things from your limited experience.

The language is not perfect (is any?) but it works and delivers business value.

If it's not your cup of tee, that is fine, but I don't see you promoting better solutions, just bashing on PHP. Some people think that that is cool, well, it's not.

Re: Upcoming changes in PHP 7.1

#79

Don't use Php. Just don't. It is a stupid, stupid piece of crap. It is very hard, even for people with more than 10 years of experience, to know all the potential gotchas that are hidden deep inside this death trap of a language [1] You will be surprised how casual the actual core development of the language is. Tiny behaviours are added, modified and removed with little or no thought and with as little justification…

"Yeah, well, you know, that's just, like, your opinion, man."

Seriously though, it's just a tool. Sometimes it's the right tool. I come from working with other dynamic languages to using (modern) PHP daily in my current job and it's fine. Absolutely fine to work with. Does it have gotchas? Sure, just as much as any other language.

Re: Upcoming changes in PHP 7.1

#80
post #20

Earlier quoted context omitted.

If you're using type signatures, the alternative is probably going to be that your program crashes at a later time. "Foo is not a Bar" is a better error message than "$foo->xyz() isn't a function", and this happens much closer to the point where you've messed up.

I disagree. I think that this type of "late type binding" is actually an advantage of dynamically typed languages. That way it does not matter if you pass a map/array/dictionary or an instance of a class as long as the properties are the same.

Then... don't specify that you want a specific type?
Post reply on HN