News for hackers. Stuff that matters.
Re:How Badoo Saved $1M Switching to PHP7 by romankolpak on Monday March 14, 2016 @07:12PM (#11286281)
I'm glad to see such positive news about PHP. It received way too much beating from the community in the last couple of years while constantly improving. Interesting to see some benchmarks on how PHP7 compares to Python and Ruby in terms of performance.
Re:How Badoo Saved $1M Switching to PHP7 by FranOntanaya on Monday March 14, 2016 @09:59PM (#11286971)
I think one overlooked good thing is how little drama I hear about the transition from 5.6 to 7. People seem to be moving on quickly (the large perf improvements help a lot). I feel it's not going to be long before almost anyone with a half skilled dev to care for it will be on 7 and we won't have a Python 2 vs 3 or Perl 5 vs 6 scenario.
Re:How Badoo Saved $1M Switching to PHP7 by pilif on Tuesday March 15, 2016 @01:32AM (#11287628)
PHP7 is much closer to 5 than Python 3 was to 2. Aside of a few very clearly defined changes, PHP 7 happily runs php5 code.

Python 3 made huge changes, especially to string handling and input/output which is what most applications do all the time.

And perl 6 is practically a completely different language. I wouldn't count that.

What is interesting about php7 is how much effort and how little complaining goes into porting the C extensions: that API has changed a lot and the documentation is still spread all over wikis and blog posts. And yet there is a php7 port of many third party extensions already

But I guess the huge performance improvements are a strong motivator even there

Re:How Badoo Saved $1M Switching to PHP7 by vpkaihla on Tuesday March 15, 2016 @02:37AM (#11287886)
The reason for that is that python2=>3 fixed several fundamental problems. 5.6 => 7 is just a incremental upgrade, whatever the version numbering tells you. Most of the PHP problems are still there.
Re:How Badoo Saved $1M Switching to PHP7 by MAGZine on Tuesday March 15, 2016 @02:51AM (#11287943)
> The reason for that is that python2=>3 fixed several fundamental problems. 5.6 => 7 is just a incremental upgrade, whatever the version numbering tells you. Most of the PHP problems are still there.

too bad for py3's fundamental problem: that it broke the interface so badly, people still don't use it. PHP7 has no such problem, and gets to add boatloads of new features (which will be immediately used/adopted) while deprecating old versions of the language.

Re:How Badoo Saved $1M Switching to PHP7 by vpkaihla on Tuesday March 15, 2016 @03:27AM (#11288048)
You don't understand. To fix problems like python3 did, you have to break older code.

Php7 did nothing like that, that's why the "porting" process was so light. But it also means it didn't fix any of the big things.

Re:How Badoo Saved $1M Switching to PHP7 by TazeTSchnitzel on Tuesday March 15, 2016 @06:21AM (#11288619)
> Php7 did nothing like that, that's why the "porting" process was so light.

This is nonsense, PHP 7 contains a long list of backwards-compatibility breaks:

http://php.net/manual/en/migration70.php

If PHP 7.0 didn't break anything, it would have been called 5.7.

The upgrade is easy simply because these breaks do not have as much of an impact as Python's did.

Re:How Badoo Saved $1M Switching to PHP7 by vpkaihla on Tuesday March 15, 2016 @06:47AM (#11288693)
No, it's not nonsense. The things you listed in there are incremental fixes, not fundamental.

http://php.net/manual/en/language.types.type-juggling.php

How would you fix this without breaking most PHP code out there?

How would you fix ==, > and < behaviour without breaking most PHP code out there?

How would you fix Unicode without breaking most PHP code out there?

If PHP fixed things like this, it would be a decent programming language, but it would also break a lot of things. Kinda of like what python3 did, only that it didn't have to break quite so much, since python2 was already pretty decent.

Re:How Badoo Saved $1M Switching to PHP7 by sunkencity on Tuesday March 15, 2016 @04:46AM (#11288256)
imho python3 fixed the issue in the wrong way, so it will never have a great amount of users: down the road the choice will be upgrade to python3 or choose a more modern programming language like go with immense performance boost. I think people will choose to leave python.
Re:How Badoo Saved $1M Switching to PHP7 by vpkaihla on Tuesday March 15, 2016 @06:54AM (#11288721)
So python will be better in version 3 and people will move to better languages? Sounds like a win-win to me.
Re:How Badoo Saved $1M Switching to PHP7 by TazeTSchnitzel on Tuesday March 15, 2016 @06:13AM (#11288601)
5 to 7 does fix some big problems, however. In particular, it is the first release with uniform syntax for variables (https://wiki.php.net/rfc/uniform_variable_syntax) and an AST-based compiler. It also replaces a lot of PHP-style errors with exceptions.
Re:How Badoo Saved $1M Switching to PHP7 by tangue on Tuesday March 15, 2016 @05:54AM (#11288532)
Python 2 => 3 is more like php4 => php5 transition; it breaks some stuff and there's no no real motivation for people to use the new version. Perl is in his own league.
Re:How Badoo Saved $1M Switching to PHP7 by spdionis on Tuesday March 15, 2016 @07:24AM (#11288811)
I am developing all my new php applications on php7, and so does everyone i know. Just an anecdote.
Re:How Badoo Saved $1M Switching to PHP7 by troels on Tuesday March 15, 2016 @04:21AM (#11288200)
Well - have you considered what happened to PHP 6?
Re:How Badoo Saved $1M Switching to PHP7 by SannisDev on Tuesday March 15, 2016 @06:32AM (#11288654)
Exaggerating, PHP6 development team did not find a consensus on the choice of UTF-8, UTF-16 and UTF-32 :-D
Re:How Badoo Saved $1M Switching to PHP7 by zapt02 on Monday March 14, 2016 @07:31PM (#11286378)
PHP has been faster than Ruby and Python for some time now in raw processing strength, see here for some benchmarks: http://benchmarksgame.alioth.debian.org/u64q/php.html
Re:How Badoo Saved $1M Switching to PHP7 by andreasklinger on Monday March 14, 2016 @07:44PM (#11286432)
afair PHP was almost always faster than ruby/python for normal web sites

The problem was usually the frameworks.

I remember benchmarks that went down in orders of magnitude as soon as you loaded a framework. That experience was 7-10years ago. I assume this changed by now.

Re:How Badoo Saved $1M Switching to PHP7 by CiPHPerCoder on Monday March 14, 2016 @07:54PM (#11286477)
That depends entirely on the framework in question.
Re:How Badoo Saved $1M Switching to PHP7 by brightball on Tuesday March 15, 2016 @12:21AM (#11287424)
Re:How Badoo Saved $1M Switching to PHP7 by imakesnowflakes on Tuesday March 15, 2016 @01:51AM (#11287705)
Php is faster than python because it lacks so many dynamic capabilities of Python. So you are loosing all that and gain a little in performance, but not anywhere near that of a compiled language. A lose lose situation...
Re:How Badoo Saved $1M Switching to PHP7 by imakesnowflakes on Tuesday March 15, 2016 @01:59AM (#11287736)
> It received way too much beating from the community in the last couple of years..

I think it didn't get the beating it deserve. If it was by merit alone, this language should be dead by now. People keep saying that it is improving. But actually it is not. The rotten core, what makes php php, very much remain, and it is still a very dangerous language to use for anything serious [1].

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

Re:How Badoo Saved $1M Switching to PHP7 by rebootthesystem on Tuesday March 15, 2016 @12:14AM (#11287394)
Every time I deploy a Python site I think "man, this is so easy with PHP" and wonder if it might be worth switching back.
Re:How Badoo Saved $1M Switching to PHP7 by ludamad on Tuesday March 15, 2016 @12:51AM (#11287522)
Genuinely curious, what makes PHP so easy?
Re:How Badoo Saved $1M Switching to PHP7 by nathancahill on Tuesday March 15, 2016 @01:09AM (#11287566)
On the most basic level: Most shared hosting supports PHP out of the box. FTP files over, and done. Also, PHP can be run by loading a URL and returning HTML, no framework required.

On a higher level: It's much harder to get right.

Re:How Badoo Saved $1M Switching to PHP7 by collyw on Tuesday March 15, 2016 @04:51AM (#11288270)
Once you have a Python environment set up its just a matter of copying files over as well for an upgrade, so I guess a lot of it is down to web server configuration.
Re:How Badoo Saved $1M Switching to PHP7 by nathancahill on Tuesday March 15, 2016 @10:10PM (#11294501)
In what environment?
Re:How Badoo Saved $1M Switching to PHP7 by collyw on Friday March 25, 2016 @12:37PM (#11361027)
That has applied to Apache and Nginx configurations that I have used.

Git pull and the code is updated. Restart the web server and you are good to go.

Re:How Badoo Saved $1M Switching to PHP7 by kbenson on Tuesday March 15, 2016 @12:45AM (#11287504)
Unfortunately, there are still some security issues popping up on a regular basis[1]. Hopefully it's at least better than 5.6 in that respect though[2].

1: https://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=php+7.x

2: https://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=php+5.6.x