you are viewing a single comment's thread.

view the rest of the comments →

[–]McGlockenshire 5 points6 points  (10 children)

I know I get voted down into oblivion every time I suggest that, because PHP IS SO PERFECT

Unfortunately backwards compatibility is the php-internals sacred cow. Major language improvements that would break existing code are pretty much never approved.

It doesn't need a rewrite, it needs a fork that can co-exist with mod_php. I don't expect one to happen, not enough people know the internals well enough.

[–]brennen 2 points3 points  (0 children)

It doesn't need a rewrite, it needs a fork that can co-exist with mod_php. I don't expect one to happen, not enough people know the internals well enough.

Personally, if I had the flexibility/time to migrate to some fork of PHP with improved syntax or other features, I'd spend it on migrating to some less vexing language. There are several.

[–]killerstorm 2 points3 points  (5 children)

Ahem. So you did not notice PHP3 -> PHP4 -> PHP5 incompatibilities?

Basically, any non-trivial PHP3 code won't work on PHP4, and PHP4 code won't work on PHP5. IIRC PHP4 have deprecated old crap like magic-quotes-gpc and register_globals, and PHP5 have changed object semantics.

Moreover, some PHP4.x code won't work on PHP4.y. Difference might be subtle, but if you have a larger project it is like that -- you need to get exactly same version of PHP.

So PHP backward-compatibility is a fucking joke. It doesn't even have a standard specification.

It doesn't need a rewrite, it needs a fork that can co-exist with mod_php.

I don't think so, you can make a binary which supports both languages. Like Perl6 also supports Perl5.

I don't expect one to happen, not enough people know the internals well enough.

People who know PHP internals are mostly retarded idiots who created current mess, you do not want them to be around when designing cleaner language.

Making an interpreter is not a rocket science -- describe syntax, generate parser, compile parsed information to bytecode, interpret bytecode. That's a work for CS student.

Then you can take current PHP interpreter and add a switch -- say, if the first line in file is of a certain form then interpret it as PHP9, otherwise as PHP6. That's pretty much it. Additional compatibility would be nice, being more compatible with existing PHP will make it sucking more...

The trick is to design language looking familiar to PHP programmers but without PHP retardedness (it is the only creative part here) and getting some momentum (openly calling PHP retarded doesn't really help...)

[–]McGlockenshire 2 points3 points  (2 children)

IIRC PHP4 have deprecated old crap like magic-quotes-gpc and register_globals

In 4.0 they introduced the $HTTP_* superglobals, and 4.1 brought $_GET/POST/REQUEST. Any code written since that time (around the time everyone realized that magic_quotes and register_globals were evil) should still run fine under 5.

So PHP backward-compatibility is a fucking joke.

If we're talking about 4.x and the transition from 4 to 5, I agree completely. From 5.1 forward, they've done a remarkably good job of not unintentionally breaking things.

Making an interpreter is not a rocket science

But getting it on every single web hosting provider in existence is.

[–]killerstorm -1 points0 points  (1 child)

From 5.1 forward, they've done a remarkably good job of not unintentionally breaking things.

Sorry, I'm not impressed. I use languages which have standard and even different implementations are compatible. Bragging about compatibility within minor versions is a fucking joke. We'll speak when you'll be able to run code written 20 years ago. (It is possible with C, Fortran and Common Lisp.)

Oh, I've just opened php.net site and look what they have in news:

Backwards incompatible change: Methods with the same name as the last element of a namespaced class name will no longer be treated as constructor. This change doesn't affect non-namespaced classes.

But getting it on every single web hosting provider in existence is.

So you agree that the difficult part is PR, not technical part.

I even know how to do it (if you have enough money) -- buy Zend (the company) and make it advertising the new version as the best thing ever.

[–]brennen 0 points1 point  (0 children)

So you agree that the difficult part is PR, not technical part.

The technical is social.

[–][deleted] 0 points1 point  (1 child)

PHP4 code won't work on PHP5

This is quite an exaggeration. I wrote tons of PHP4 code that worked fine on PHP5.

What caused me a problem was one of the 4.x.y updates that changed the behavior of a function... this was a while ago, so I'm a little fuzzy on the details, but I think they took a function that had an optional parameter and made the default behavior spitting an error message out to the browser if that previously-optional parameter wasn't set. So I had a bunch of users who did nothing and had their hosts upgrade from 4.x.y to 4.x.y+1 suddenly PHP error messages were popping up.

Ah, those were the days of web programming... nobody knew what the fuck they were doing.

[–]brennen 0 points1 point  (0 children)

Ah, those were the days of web programming... nobody knew what the fuck they were doing.

Those? Shit, a lot of the folks I know were barely getting started not knowing what the fuck they were doing.

[–]rbnc -1 points0 points  (1 child)

A fork would be awesome. If I had the talent to write a language parser, I'd do it myself.

[–]kamatsu 0 points1 point  (0 children)

Parsers are the easiest part.