PHP Days and PHP Unconference Europe

I spend most of the last week or so over in Manchester for a combination of excellent PHP-related events: PHP Unconference Europe on Saturday and Sunday (with a rather excellent warm-up party on Friday night!), followed by the PHP Days training on Monday and Tuesday.

PHP Unconference Europe

A large crowd gathered very early on Saturday morning at the Pitcher and Piano, and got our briefing on how session voting works (everyone gets 4 stickers, you stick the stickers onto the sessions you want to see, the ones with the most get scheduled).
DSCF4430.JPG

Continue reading

Using Gearman from PHP

I’ve introduced Gearman into a project I’m working on, and since a few people have asked I thought I’d share my experiences. Basically, this application generates some PDFs from a variety of data sources, makes images, and emails it. Since the whole data processing, image handling, PDF generation process is fairly heavy, I’m putting the requests to generate these onto a gearman queue and having some workers process the jobs. The eventual aim is to bring up EC2 instances (or php-specific cloud hosting perhaps? Recommendations gratefully received!) to do this work but right now I have one worker and it’s all on one server.

Continue reading

Callbacks in PHP

Recently I was working on something and I wanted to call an object method as a callback, but got confused when I realised the method had been caused statically. This was caused by my inability to RTFM and I wondered how I’d come so far without actually coming across the many and varied things you can pass into any place a callback is needed. I think we’ve all seen a function callback; something like this:

function myExcitingFunction() {
  // do something remarkable
}

call_user_func('myExcitingFunction');

You can also call methods of objects rather than just plain functions, and this is where I tripped myself up.
Continue reading

27 Ways To Be A Better PHP Developer

Last weekend I was at the PHPBenelux 2011 conference in Antwerp. As conferences go it was pretty awesome, completely surpassing my expectations in many ways! The schedule was published in advance but I somehow forgot how many friends I have in that part of the world and what a wonderful crowd there is at this event. My hearty congratulations to all the organisers and my thanks to everyone who attended – they used joind.in for the feedback and there are plenty of comments on there too, which I now consider a metric of how engaged a community is!

I was at the conference to give a keynote with ex-colleague and good friend Ivo Jansch. We gave our new talk “27 Ways To Be a Better Developer” in the opening keynote slot, which was a lot of fun (even if I did freak out slightly and hide in the middle). Ivo and I have lots of experience of working with developers, recruiting, running teams, and we had a great time working out *which* 27 items to include and how to tell the story. It was a little bit hectic since we had about 50 minutes to give the talk but we had some generous reviews and so many people have come and told me about one or two points that have made a big impact on them. These are the slides:

Thanks again to all who made this event what it was – organisers, sponsors, speakers and attendees!

Number System Primer

I regularly teach the Zend Certification course and one thing that really splits those with a Computer Science background from those without is handling number systems other than decimal. Personally I don’t see it as a major omission, I certainly don’t work with those systems very often in web development! However, ZCE includes decimal, binary, octal and hexadecimal numbers in its syllabus, so I always make sure to stop and teach it. Here’s a quick round-up of how they work:

Continue reading

Preparing for ZCE 5.3

Recently I have been getting to grips with the ZCE since it was updated to take account of PHP 5.3. In the last few weeks I’ve both passed the certificate myself and also taught Zend’s certification training course as a classroom course at NTI Leeds. I thought I’d share my top tips for preparing for taking the ZCE – getting to the standard, last-minute preparations, and also some tips for surviving the day itself (disclaimer: everyone sitting the ZCE signs a declaration not to disclose the contents of the exam, so I can’t actually tell you the questions, sorry!)

Continue reading

ZCE 5.3: Worth Doing?

I recently took (and passed!) the ZCE 5.3 certification. I’ve been a Zend Certified Engineer (5.0) for nearly 3 years, and I know a lot more about PHP today than I did then. Today I speak and write various things related to PHP, and also teach all sorts of topics including PHP certification. I thought I’d share my thoughts on the ZCE, and I’ll write a follow-up post on how to prepare for it.

Updated Syllabus

The main thing that annoyed me about teaching people for the 5.0 exam in the last couple of years is that it had a topic on the differences between PHP 4 and PHP 5. Personally, I have never worked commercially with PHP 4, and that’s true for lots of developers that I meet. So I ended up trying to teach PHP 4 which seemed silly! Happily that is gone now from the 5.3 Syllabus.

There are some new topics and I’m pleased to see the Web Features topic being added. This brings together some HTTP concepts and overall client/server architecture stuff that really helps round out the syllabus. I consider that studying for the exam is in the interests of all PHP developers, these topics are all useful and relevant.

Continue reading

Declaring Static Methods in PHP

I was confused recently to realise that I had accidentally called a static method in PHP dynamically from another part of my code; I expected PHP to output warnings when this is done. On closer inspection I discovered that:

  • Static functions can be called dynamically
  • Dynamic functions generate an E_STRICT error if called statically

This made a lot more sense when I thought about it a bit more and wrote some toy code:

Continue reading

PHPUnconference Comes to Manchester

I’m very excited to hear that the PHPUnConference Europe (@phpuceu on twitter) is coming to Manchester on February 19th and 20th! So excited, in fact, that I’ve rushed out and bought my ticket (for a whole £40, that’s a good investment in my opinion). The event brings together the PHP community from across Europe to an unconference where the speakers are the presenters, and really anything goes!

A great feature is the contributions and interests section – if there’s some content that would be particularly useful to you, or a talk you think would be a good fit, then you add it on this page. All the attendees can vote for which sessions we want to see and so we crowd-source the best lineup possible :)

If you fancy some more structured PHP training then hang around in Manchester after the event because thePHPcc are bringing their PHP Days training to Manchester on the Monday and Tuesday following the weekend event, which is pretty exciting :)

Hope to see you in Manchester, all I need to do now is work out which topics I want to see/give talks about …