Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

HHVM Blog:
Covariance, Contravariance, and super Type Constraints
May 29, 2015 @ 10:13:24

The HHVM blog has a new post that talks about covariance, contravariance, and super type constraints - enhancements to the previous generics handling in the Hack language.

Hack has recently enhanced its generics with two features: variance annotations and super type constraints. In this post, I’ll explain how they work and why they were added.

They start with variance and how the idea of covariance (consistent type variance in class parameters) fits in. They include a code example showing how this typing works and some of the issues with following this covariance flow. Following this they talk about contravariance, the opposite of covariance, where the typing can be used as a parameter type but not a return type. They go on to talk about the idea of "super type constraints" and how they augment the current type constraint handling to provide improved type resolution. They end the post with a bit about how "super" relates to "as" constraints and a historical note about some hard-coded class names that are always resolved as either co- or contravariant by the typechecker.

tagged: covariance contravariance super typeconstraints example history

Link: http://hhvm.com/blog/9215/covariance-contravariance-and-super-type-constraints

Matthew Weier O'Phinney:
PSR-7 Accepted!
May 20, 2015 @ 09:55:41

As Matthew Weier O'Phinney mentions in his latest post, the PSR-7 standard (HTTP) has passed and is officially accepted as a standard by the PHP-FIG group.

The road to PSR-7 was a long and winding one. It started in summer of 2012 as a draft proposal on HTTP clients by Benjamin Eberlei, during which others proposed that perhaps a smaller standard on the HTTP message interfaces themselves — which would also allow targeting server-side applications, as those rely on the messages.

He follows the proposal's flow through the PHP-FIG process, pointing out several others who contributed along the way and what changed along the way. He also includes a section of thanks for some of the other developers and PHP-FIG members that made contributions along the way.

tagged: psr7 phpfig accepted standard history

Link: https://mwop.net/blog/2015-05-18-psr-7-accepted.html

Derick Rethans:
Code Coverage: The Present
Dec 02, 2014 @ 11:54:01

Derick Rethans has posted the first in a series focusing on the Xdebug tool and the code coverage functionality it can provide via PHPUnit's testing. In this first post he catches the reader up on the current state of things and what all the Xdebug tool can do.

Since ages Xdebug has provided code coverage support for PHPUnit, a way to show which lines are covered by your test cases. But I never really wrote about how it works. A recently filed bug prompted me to write this post, as well as a follow up post on Code Coverage's future.

He starts off with the early days of Xdebug, how it hooked into the Zend Engine (that powers a lot of PHP behind the scenes) and when it was triggered. This came with its own set of problems so Xdebug was updated to overload some opcodes. He talks about how it can calculate the unused lines and determines which lines can be covered in the code coverage results. He provides some example code showing the execution of the coverage report on a simple function and try/catch handler, complete with the HTML output of the results.

tagged: xdebug codecoverage phpunit coverage history functionality opcode

Link: http://derickrethans.nl/code-coverage.html

Community News:
Do You Know PHP? (Quiz)
Nov 19, 2014 @ 10:53:23

Think you know a lot about PHP? Well, the folks at PHP Weekly and mogosselin have put together a fun little quiz you can use to see just how much you know your favorite language.

Question topics cover things like:

  • Notable people in PHP's past
  • "Meta" about the language itself
  • The future of the language
  • Projects from around the PHP community
  • PHP security topics
  • Plenty of tricky code questions

...and that's all the hints you're going to get. Go over and test out your knowledge and see how you rank against the other developers taking on the challenge!

tagged: quiz fun language history future project questions results

Link: http://markonphp.com/php-quiz-2014/

Acquia Blog:
PHP is getting Faster
Nov 04, 2014 @ 13:35:29

On the Acquia blog they've posted another in their guest post series, this time from Richard Miller, a Senior Technical Consultant with SensioLabs (the people behind the Symfony framework). In this new post he talks about how the performance of PHP is getting better and why.

PHP is not the fastest language in which we could write web applications, yet we continue to do so for many other reasons. Pure speed of a language is rarely the main deciding factor for many projects. [...] So why worry about the speed of the language at all? Well, application architecture is improving and we are finding ways to avoid all those other bottlenecks. [...] Trying to gain speed through profiling and optimising code can be a long and tedious process. Thankfully, improvements in the speed of the language itself give us an improvement in these other areas for free.

He looks at "a brief history" of the language and the major milestones that have lead to the biggest performance gains over the years. He also talks about some of the alternatives out there to "normal PHP" for execution including the HHVM and HippyVM projects. He ends the post with a warning, though - be careful of fragmentation and separation of the community based on these different tools and embrace things like the language specification to keep things on an even keel.

tagged: community acquia faster performance history runtime projects

Link: https://www.acquia.com/blog/php-getting-faster

SitePoint PHP Blog:
What to Expect from Yii 2.0
Sep 22, 2014 @ 12:32:17

The SitePoint PHP blog has a new post today from Arno Slatius that talks about some of the features coming in Yii 2.0, a PHP-based MVC framework with a target for a stable release coming very soon.

Yii 2.0 was released into beta last April and the goal for a first stable release was set for the middle of 2014. The GitHub issue list has 300 open issues and 2913 closed while I’m writing this and both numbers are still increasing. The progress to the 2.0RC milestone was at 99%. My guess is that the team is close, but we’ll probably have to wait just a little bit longer. While we’re all waiting, lets take a look at what we can expect by looking at an already available example.

He starts with a "tiny bit of history" about the framework (its origins, the work done on 2.0) and talks about some of the requirements to get it installed and working. He helps you set up a sample project and shows off the Twitter Bootstrap integration, the debug bar and the "Gii" tool that can help generate code automatically (following the conventions of the framework). He finishes off the post with a look at some of the main things that changed in the 2.0 release including moving some method calls to properties, datetime handling, behavior definitions and model/view updates.

tagged: yii v2 introduction tutorial changes requirement install gii history

Link: http://www.sitepoint.com/expect-yii-2-0/

Halls of Valhalla:
From PHP 5 to 7
Sep 22, 2014 @ 10:56:32

On the "Halls of Valhalla" site there's a new post the tries to explain the jump from PHP5 to PHP7 and what all that means for the language (and community around it).

Since around 2005 we've heard talk about PHP 6 development. There have even been books sold about it. But where is it? As of July of this year it was decided that there won't be one and that PHP will skip directly to version 7. Why is it skipping to the next major version, and what ever happened with PHP 6? And if we're already jumping to PHP 7, what kinds of features will it have?

They start with a "brief history" of PHP since its inception back in the mid 1990s and follow its evolution at a high level through the years. Then comes the topic of PHP6 and the work that was already being put towards it and integrated Unicode support. It talks about some of the difficulties of this conversion and the delays that ended up happening. Instead, it was decided that things would stay in the PHP 5.x series and 5.3, 5.4 and 5.5 have been created since. The jump to PHP7 came from this vote with several different reasons influencing the decision.

The post finishes with a look at some of the new things that will be coming in PHP7 including major performance improvements, abstract syntax tree functionality and asynchronous programming, allowing for the execution of parallel tasks in the same request.

tagged: php5 php6 php7 community unicode language history features

Link: http://halls-of-valhalla.org/beta/news/from-php-5-to-7,146/

Three Devs & A Maybe Podcast:
The First All-Episode Quiz
Aug 14, 2014 @ 09:17:35

On the latest episode of the Three Devs & A Maybe podcast Michael Budd, Fraser Hart, Lewis Cains and Edd Mann have their first quiz show (Episode #38).

This week we start our chat off with the myth of just simply 'reskinning' a website, along with the dreaded !important in CSS. Following this, as we love quizzes so much, we decided to dedicate a full show to one. In this weeks quiz we touch upon many areas of PHP, JavaScript, CSS and random computer/programming history. We also now have t-shirts on sale, available via the first link in the show-notes (why don't you treat yourself).

Topics discussed in this episode include AngularJS fundamentals, speed in software development and avoiding burnout. You can listen to this latest episode either through the in-page player or by downloading the mp3 directly. If you enjoy the show also consider subscribing to their feed.

tagged: threedevsandamaybe podcast ep38 quiz episode reskin css history

Link: http://threedevsandamaybe.com/posts/the-first-all-episode-quiz/

Grant Lovell:
Why PHP doesn’t suck anymore
Jun 17, 2014 @ 09:04:07

In a recent post Grant Lovell shares some of the reasons why he thinks PHP doesn't suck anymore based on his presentation from the Waterloo-Wellinton Webmakers.

Chances are if you have been in web development for any amount of time you have done some work with PHP and maybe it was a great experience like it was for me, or perhaps it was hours and hours of digging through WordPress code to figure out why a plugin wasn’t working. [...] A friend from U of W was giving me a hand setting up the catalog and introduced me to PHP. He was able to build the whole catalog, at least a basic first version, in one afternoon. You can imagine I was pretty excited about something that I thought was going to be weeks of cutting and pasting being done in a few short lines of PHP code. From then I was hooked.

He looks at a brief history of PHP, from its beginnings as a set of simple scripts by Rasmus Lerdorf out to the current push and support of the language by big companies like Facebook. Despite all of this, he points out that PHP "went wrong" somewhere along the way thanks to things like bad tutorials and practices. He talks about the GoPHP5 initiative and some of the signs of improvement in PHP: frameworks, Composer, the FIG and the "PHP renaissance." He looks into the future and sees only improvement thanks to better tutorial content (on various sites) and the increased amount of cooperation between developers wanting to make the language better.

tagged: opinion suck language history improvement future

Link: http://transmission.vehikl.com/why-php-doesnt-suck-anymore/

Phil Sturgeon:
Heroku and PHP Sitting in a Tree. K.I.S.S.I.N.G
May 12, 2014 @ 09:40:49

In a recent post Phil Sturgeon talks about the recent news from Heroku about their integrated PHP support and some of his own experience in using the new service feature and migrate his blog over.

Heroku was - as far as I remember - the first (mainstream) PaaS on the market. It was Ruby-only but it was that symbol of modern web development at the time, with the whole "slinging code", "getting shit done", make a Git repo and start shipping bro, hack project/agile-til-it-works mindset. [...] Git push your code, its deployed, one-click installs and drag to scale. It sucked that it was always for Ruby, because as I was also doing a lot of work in PHP I obviously wished I could have the same for my other projects.

He walks through some of the "evolution" of the PaaS (platform as a service) market as it related to PHP environments. He talks about other services like PHPFog, Pagodabox and Fortrabbit. The Heroku added true PHP support and he made his move. He goes through the steps he followed to get his blog migrated over and the commands needed to make the push.

tagged: heroku paas platform service history support pyrocms

Link: http://philsturgeon.co.uk/blog/2014/05/heroku-and-php-sitting-in-a-tree