

PHP 5.5 - dave1010uk
https://github.com/php/php-src/blob/php-5.5.0/NEWS

======
michh
Seems like a bunch of really welcome improvements. Wish I hadn't known about
them though, as I probably won't be able to use them in our production
environment for the next 2 years or so.

~~~
Tomdarkness
Can I ask why it will take so long? I'm working on a medium to large scale
project and we will be likely rolling the new version out to our staging
environment within a week and assuming everything goes smoothly to the
production environment not long after that.

~~~
griffindy
If michh is working on plugins for other people, shared hosts can be pretty
behind on their PHP versions. I just had to backport a wordpress plugin to
5.2(!), which came out in 2006.

EDIT: meant PHP versions, not plugins.

~~~
wdmeldon
Thats the curse of distributable code unfortunately. And PHP only makes it
worse because it's old versions are absolutely terrible...

~~~
maratd
> And PHP only makes it worse because it's old versions are absolutely
> terrible...

You just need to put your foot down. 5.2 is absolutely too much, I would never
develop for it. Just tell them to stop being so damn cheap and upgrade to a
decent hosting company. AWS is free for a year for new clients, there's no
reason for them not to switch to something decent.

------
manuletroll
Am I the only one thinking PHP needs more stuff removed rather than added ?

~~~
TheAnimus
I sort of agree with you, but then I come at it from the view point of why
choose PHP? Myself, I can't think of a single awnser, but then again I'm the
kind of person who learns a programing language or paradigm for fun.

However there is an elephant in the room with PHP, it has, quite frankly some
terrible creations made by it. In much the same way MS had a whole bunch of
technologies around DCOM and the like which suddenly found themselves disabled
and strongly advised against use in XP SP2. I think PHP really does need to
try and clean up its image.

The whole 'lets go find some sql injection vulns on github' game demonstrates
many people still use the tool badly.

At what point does someone say, that they should re-design the tool, so that
they encourage better use.

I'll be honest, if I hear someone say "we're using php for this" I assume its
just because they are ignorant of other languages. I can't think of any
problem I've been faced with, where PHP is the best solution.

So ultimately, if your going to try and remove stuff, why bother, you'll only
break the existing projects, rather than improve them. The best thing is to
treat the language as depreciated.

~~~
kmage
> I think PHP really does need to try and clean up its image.

Sorry, but you obviously have not been taking notice over the past year or
two. PHP really has been cleaning up its image. Go have a look at PHP-FIG,
composer and packagist for starters.

Yes, there are problems. Yes, some/most may think that there are better
solutions. But to think that PHP has not been "cleaning up its image" is just
wrong.

~~~
TheAnimus
>Sorry, but you obviously have not been taking notice over the past year or
two.

I'll admit, I haven't really, because I'll turn it round, why would I?

We've seen Erlang start to be used quite a lot, Scala is becoming very
interesting, and F# is appearing suitably mainstreme.

What features would make me think "hmm, I should check out what they are doing
in PHP"?

Looking now I still see a cluttered array of APIs, some pretending they are C
from the 80s, others hinting that they at least knew of objects in their
design.

A quick look for static analysis rule systems for say our CI system:
[http://mark-story.com/posts/view/static-analysis-tools-for-p...](http://mark-
story.com/posts/view/static-analysis-tools-for-php)

Wow, that's pretty poor.

What I do again see, are PHP developers who are not fluent in any other
language. I always find that odd. For instance I've been doing mostly C# since
version 2. But I would probably pass most Java or CamL interview questions
anyone had. I am happy in C# knowing what I am missing from other languages
(well, not happy, just its the right choice for the things I've been doing).

In short, PHP has an image problem with plenty of people. I am one of them.
They can't easily solve it, without breaking a whole bunch of existing code,
as most of my complaints are inherent languages _features_ and core API design
(or lack there off). I don't nock languages that eschew OO, but I do nock ones
that implement it, just very, very badly.

~~~
coldtea
> _We 've seen Erlang start to be used quite a lot, Scala is becoming very
> interesting, and F# is appearing suitably mainstream_

Your definition of mainstream must differ from the dictionary's.

~~~
TheAnimus
>Your definition of mainstream must differ from the dictionary's.

I have got the same two agents constantly bugging me "oh you know some Erlang
right?" at the moment, but the only one that I begin to describe as mainstream
is F#.

If your in any kind of LOB space which deals with 'Maths' F# is rampant now.
Which is handy for me, as I used to instruct labs on OCaml at uni.

Just using www.inqjobs.co.uk looking in London for contract rates on 500pd+ I
find over 20 roles for F#. Compare that to the Python or Ruby number.

That to me, is mainstream. Not quite Java/C++/C# league, but certainly out
there.

------
kodablah
One of the most overlooked features of this release is the "::class" option.
Using fully qualified string literals for type (class, interface, and trait)
names has really hurt refactorability.

------
conradfr
I can see array_column being useful instead of using foreach on sql query
results.

~~~
dexen
...or PDOStatement->fetchColumn('column-name').

~~~
ihsw
PDOStatement->fetchColumn() accepts only integers as an argument.

[http://ca.php.net/manual/en/pdostatement.fetchcolumn.php](http://ca.php.net/manual/en/pdostatement.fetchcolumn.php)

------
thejosh
Biggest change? \- Drop Windows XP and 2003 support

~~~
dave1010uk
Most interesting things for me:

* PHP is getting the yield keyword (i.e. generators and coroutines), which many other languages have had for a while.

* A sensible and simple built-in password hashing API

* Error when using the deprecated mysql extension, which should hopefully get more people moving to PDO (e.g. WordPress: [http://core.trac.wordpress.org/ticket/21663](http://core.trac.wordpress.org/ticket/21663) )

~~~
rmccue
I'm trying to push for that WordPress ticket, but it's unlikely that we'll get
any significant traction for a while. The database class in WP (apart from
being fairly horrible) is a huge component to make major changes to like that,
and we have to consider backwards compatibility.

Here's hoping it gets merged in the next 5 major releases. I'm not holding my
breath.

------
bratao
You can have a modern development framework for php. You guys should try
[http://laravel.com/](http://laravel.com/) such a fresh air into php
development.

------
magnetikonline
A nice meaty change list there. Get compiling :D

------
dave1010uk
Download:
[http://php.net/get/php-5.5.0.tar.bz2/from/a/mirror](http://php.net/get/php-5.5.0.tar.bz2/from/a/mirror)

------
dkhenry
And what I still don't see is anything saying they are taking their
performance problems seriously. Still nothing saying they are fixing their
documentation. Nothing addressing their hodgepodge of legacy code and mixed
methods of implementing features. Its like their upset that people have moved
on, but instead of providing a better core for people to build products on
they keep adding chrome to the fringes of the language hoping to get more
people sucked into developing for it only to realize that once they do
anything of significant size in PHP they will need to do a full rewrite into a
language that can actually scale or turn to a PHP to C++ lexer to actually get
a product that doesn't also server as a Data center toaster oven.

~~~
RossM
Out of interest, what do you find wrong with the documentation? I've always
found it pretty comprehensive and relatively easy to navigate.

~~~
Navarr
Generally very little, but there _are_ things like
[http://php.net/trader_stoch](http://php.net/trader_stoch)

~~~
polyfractal
To be fair, that is an optional extension and not bundled into PHP by default.

------
pjmlp
Now I just have to wait my ISP would eventually some day upgrade from 5.3.

~~~
coldtea
Or you now, get with the program and get a VPS like everybody else.

~~~
voltagex_
I don't think this is a solution for everyone. Even though VPSes are cheap, if
you're not making any money from running them, they're still a cost to you.

~~~
coldtea
> _I don 't think this is a solution for everyone._

No, but it's very much a solution for any HN developer in a Western country.

He knows what to do (hence "HN") and the money are insignificant.

I got a 512MB SSD VPS for $5/month from a major player. Similar plans exist
all around. If $60/year is a "cost to you" and you are a developer in the
US/Western Europe, then you're doing it wrong.

~~~
BaconJuice
Mind sharing this $5 vps please? I'd like one.

~~~
anentropic
Digital Ocean

~~~
elclanrs
Great! Just got an account with them and set up NodeJS in 2 minutes. Love that
there is month to month payment and that you can change the plan. The control
panel is very nice. Next PHP 5.5...

------
porker
Best resource for learning about coroutines in (PHP|general)?

~~~
stevelaz
Check out Lua Coroutines, here's a starter link: [http://lua-
users.org/wiki/CoroutinesTutorial](http://lua-
users.org/wiki/CoroutinesTutorial)

------
zemo
>Exceptions can be thrown into the generator using the Generator::throw()
method.

>Rewinding a generator

...wut

------
angersock
They added coroutines in a minor number patch. wat.

~~~
pilif
Just as rails has added the asset pipeline in a minor number patch. Or as ruby
changed to unicode with 1.9. Or as python added a whole new syntax for
exceptions with 2.6. As with many other languages, incrementing the minor
number usually means quite big changes while more or less keeping backwards
compatibility.

Changing the major number is something that's done when backwards-
compatibility is hugely affected.

The exception is probably ruby which greatly broke backwards-compatibility
with 1.9 (unicode) and mostly just changed internals with 2.0

~~~
angersock
Oh, I'm not about to hold up ruby or python as shining beacons here--though I
will smugly admit that the rubyists seem to be pretty fast at updating their
gems.

Still, it's weird practice nonetheless, right?

~~~
pilif
Actually, I think it's fine for languages:

Backwards-Incompatible change? Increment Major version

Many new features, but (largely) backwards compatible? Increment Minor
version.

Bugfixes? Increment Patch.

I think this also perfectly maps to Semantic Versioning
([http://semver.org/](http://semver.org/))

------
smaili
PHP - where technology meets obesity :)

~~~
krapp
It's not fat... it's overloaded...

