Some interesting stuff I found while browsing my RSS feeds, upcoming new stuff in PHP 5.5, a site called PHP The Right Way, and it looks like PHP will finally have some kind of official coding style.
What PHP 5.5 might look like
Made by Nikita Popov, it takes a look at some new features that might arrive with the 5.5 release. It looks like PHP will borrow some stuff from other languages, namely C#-like getter/setter functionality, and generator functions and list comprehensions from Python which are awesome, Marius Ghita shows a clever use case for them. There are many other quality-of-life goodies there, like scalar typehinting, parameter skipping (though I kinda hope they will borrow named parameter passing from Python), constant dereferencing (same as the array dereferencing, which just came in 5.4, but for constants), and many others. What really surprises me is that a lot of these features are already in, and only a few are in a proposed status. Read the whole article for details.
PHP Framework interop group
The idea behind the group is for project representatives to talk about the commonalities between our projects and find ways we can work together. Our main audience is each other, but we’re very aware that the rest of the PHP community is watching. If other folks want to adopt what we’re doing they are welcome to do so, but that is not the aim.
PHP-fig is trying to introduce some coding standards. You are obviously not required to follow it, it’s just some nice guidelines that you can follow, if you want. You are probably using PSR-0 already, but we have a PSR-1, and a PSR-2 now. I’m a hundred percent sure that PSR-2 will be flamed to death, since it’s about a standard coding style.
You could ask Why the hell should I follow some random guy’s coding style? Personally, I think it is a good move in a good direction. Every workplace/project/framework has their own coding style, it’s frustrating and hard to always retrain myself. I don’t care if it’s spaces or tabs, just decide on one, and let’s use that. Also, the guys behind the group are some of the most brilliant PHP developers in the world (all of them are authors of well known frameworks), I trust them.
PHP the right way
I wish PHP The right way existed a few years ago when I started working. There is a shitload of misinformation, outdated howtos, and awful tutorials that spread security vulnerabilities on the net (and sadly in the PHP documentation comments section). It’s very easy to get misled into bad practices, or I could say it’s extremely hard to find the good, and correct tutorials when it comes to PHP, because there are so many.
It deals with getting PHP up and running, introduces the aforementioned PSR standards, the SPL (Standard PHP Library), talks about Security, Composer, Testing, Web Servers, advocates using a database abstraction layer instead of the deprecated (and dreaded) mysql_* functions, and a lot more things that are essential or at least good to know.
The main author is Josh Lockhart (author of Slim) in case you are wondering, but there are many contributors, and contributing is just a github pull request away.