Tag Archives: Php

Getting good PHP programmers

One of the interesting conversations I had during Zendcon was while talking to a recruiter.  She asked what questions she could ask to help guage how strong a PHP developer is.  The best one I could come up with was "name 6 of the 10 variable types in PHP".  I've had the pleasure of being able to interview several people for working at Zend and that is usually one of the first questions I ask and I can usually get a good feel for how long the conversation will be after that.  It's an esoteric question but by asking it I can guage a) how well that person knows PHP, and b) how easy it will be for me to work with them.  If they know the answer (and correct it) they know their PHP.  If they don't know the answer but get flustered or angered by it, then they will probably be harder to work with.

But the truth is that most of the people I've interviewed, and who have eventually worked with me, I've recommended after simply talking with them without a script.  I've interviewed a bunch of people for Zend Services and I think that the best interviews were the ones where we just talked tech.  The times when I was going off of a script was usually when I got the feeling that they wouldn't be a good fit.  Especially if they had attitude issues.  They would be going out in front of customers and if I thought they would have attitude problems I would start pounding them with questions that they probably didn't know and see what their responses would be.  They could answer correct or incorrect but what I was looking for was their reaction.  More often than not it was quite easy to pick out the people that I would not put in front of customers.  In fact, I would take someone who got more questions wrong, but could keep from getting frustrated over someone who would get them right but act incredulous.  I was interviewing one person one time who would be working as my counterpart in Services who got kind of upset with me and said "I don't need to know those things to do this job."  That conversation didn't last much longer than that.  Not because he didn't know, but because he lost his cool.

But, I'm getting a little off-topic, mostly because I like reminicing over some of the more colorful interviews.  That is what brings me to the point of this blog posting.  I can interview for certain (but by no means all) PHP positions because I know a fair about PHP and I believe that being smart but being an asshole does not make you a good PHPer.  But not everyone who interviews knows that.  And not only that, it is getting difficult to find good PHP developers.  A lot of the good ones are being taken up by top companies, but even they are having trouble finding all the good developers they need.

The point

Because of that, I would like to see if we couldn't (pseudo) standardize on deciding what makes a good PHP developer.  In other words, if someone asks "what does a good PHP developer look like" we could give a concise answer.  Jim Plush actually blogged about this a few years ago and I think that what he said there was quite accurate.

But it doesn't end there.  Knowing what makes a good PHP developer is not enough.  In order for PHP to succeed we need to raise the competance of all professional PHP developers.  And when I say "make PHP succeed" I'm not talking about the simple number of domain names where PHP is run on.  What I mean is increasing the quality of PHP developers to the point where companies who run PHP-based applications are able to fulfill their need for good PHP developers.  What I also want to do is get a feeling not only for what good PHP developers look like but also what they can do, specifically, to increase their value.  Being a ZCE is one example, but the ZCE exam can only do/tell so much.

For example, if someone should know XHTML, WHAT should they know, WHERE can they learn it properly and HOW will they know when they know enough.  We're real good at saying what, in general, developers should know (e.g. Unit Testing), but we're not so good at being specific.

For the record, I have my idea of what should be done, but I'm one person with one point of view.  What is your point of view?

Specifically (since we're being specific)

  1. Is there really a shortage of good PHP developers?
  2. Is there an interest in some level of semi-official developer standards beyond being a ZCE/ZFCE?
  3. What are the significant topic areas that PHP developers should be reasonably expected to know well?
  4. Should these questions be broken down by discipline?  (e.g. backend developers, web page designers, performance gurus)

If you have answers/thoughts concerning these questions you can either post them in the comments or email me at kevin at zend . com.

@DragonBe is awesome

After I posted my slides for use by user groups Michelango van Dam of PHPBenelux posted on the Zend Facebook page that people could use his too.  They are CC-licensed so you are free to use them as well.  So I asked if he could provide the PPT versions so I could post the full deal for people and he agreed.  So here are three presentations that Michelangelo did that you can use for your user group as well.

Why Zend Framework powers the enterprise – In this preso, Mike talks about (surprise) why it is that Zend Framework has become so popular in the enterprise.

Unit Testing after Zend Framework 1.8 – This was an interesting presentation in that it talks about how to unit test Zend_Application-based applications.

Improving QA on php projects – Another interesting one on testing, though it gets much deeper into unit testing in general.

Read first, then tweet, for a free book

A few weeks ago I blogged that I was going to give away 9 copies of my book, You want to do WHAT with PHP?  Well, today is the day to start.  There are a few ways you can win.

  1. Tweet this page.  You can use the kudos link on the top right of the page, retweet it, or tweet it on your own, but it MUST be under the hashtag of #ywtdwwphp.  If you use the kudos link, that tag will be automatically added to your tweet. That is how I am tracking who to put into the random drawing.  I will be making my drawing around 12:00 noon, central time, on Friday, November 12th.  That's tomorrow.
     
  2. Join my Facebook page for the book.  Around the same time I do the drawing from Twitter I will be choosing a random person from all of the people who like my Facebook page.
     
  3. If you are part of a user group AND the user group has a member library, have the user group maintainer email me.  The information that I receive MUST match the Zend local user group information.  I will make that drawing on Wednesday of next week

I will do this three times over the next three weeks since the publisher gave me 9 copies to give away.

One last thing, you are getting the book for free but you will need to still pay shipping costs if you win.  USPS estimates about $13 to ship almost everywhere.  Cheaper in the U.S.  But, I will use any shipping method that you like.  For example, if you wanted something with a tracking number.  So, before you retweet make sure that you a) know what it will cost to ship to your address, and b) are willing to do that.  I will accept PayPal to cover the shipping costs.  If you win, but don't want to cover shipping costs I will politely thank you for entering, and run the random person selector again.

If you want to increase your odds of winning both RT this page and join my Facebook page.

If you want to, or need to, contact me, email me at [email protected].

Good luck!!

Free slides for user group meetings

One of the problems I have heard that user groups have had is that it is quite difficult to get content.  Some of the larger, or more active ones, may not have as much of a problem with this but a lot of the smaller ones that I've talked to do.  So what I've decided to do is, in effect, open source a lot of my presentations for re-use at user groups.  What that means is that if you are looking for content specifically for a user group feel free to use some of my stuff to help you along.  No warranty or support will be supplied, and they are provided "as-is".  What that means is that if you see something on there that is weird or perhaps even "wrong" I was probably using it as a keyword or reminder for something I wanted to say.  So, if I wrote something that was spot-on, it was intended, if I wrote something that was wrong or inaccurate, I was trying to prove a point.  It's called nuance.  :-)

I am also going to provide several of the workspaces and projects that I used for delivering these.  Again, treat them with a grain of salt.  Often examples are done in the interest of expediency and I have a tendency to not re-use content, which means re-writing a lot of stuff, quickly, because I speak for a variety of audiences.  And, like the PPTs, I won't be able to provide much by way of support.  If it don't work, you'll probably be on your own, unless, in the vastness of my free time, I am able to help.  Also, I did all of my stuff using Zend Studio, so if there are project-related issues, using Zend Studio might help.

Caffeinated PHP – This is based off of the first presentation I did.  Since I kind of came from a Java background that was the easiest thing for me to do that differentiated myself right off the bat.  This is an updated presentation that I gave at Zendcon in 2009, I believe.  It talks about integrating PHP and Java using the PHP/Java Bridge in Zend Server CE.

There are two projects.  One called Caffeinated PHP, which contains a UI to all of the examples that I worked on.  Most of the examples work with just standard Java.  However, one of the examples uses JMS to connect to ActiveMQ and another uses JPS (Java Printing System) to print to a local printer.  The latter has a simple abstraction layer that provides some basic info to PHP. 

PHP Security.  This talk is an intro to some of the things that PHP developers need to know to help build apps that don't have glaring security holes.  Security is a complicated topic and as such this will not be complete.  However, there is some good content for you to re-use.

Deployment.  I have given this talk a few times and it seems to be relatively well received.  If you decide to use it, make sure to follow the links to the blog posts that I did on this, especially for the PEAR and RPM ones.  This does not cover Continuous Deployment or build tools such as Hudson.

PHP Performance.  Performance, like security, can be a very complicated topic.  What this presentation does is look at some common problems, common symptoms and common remedies. 

I think I have 3 or 4 more I will upload but it's approaching the end of the day and I'm trying to recover after Zendcon so we'll leave it at that for the time being.  Feel free to use all or part of these presentations in a user group.  Please do not use them in webinars or anything that is intended for commercial production/promotion.  If you want to do them in that kind of a context please contact me and I would be happy to do a joint webinar with you (pending boss approval, of course).

If you have criticism I am open to it, but do remember that when building for a presentation you are building for clarity.  Bear that in mind.

Zendcon coming up

I had just tweeted something about Zendcon; how there were so many good sessions that it sucks that attendees have to choose between so many good ones.  I mean, look at the sessions that immediately follow the keynote on Tuesday.

  • Integrating PHP with RabbitMQ – Alvaro Videla
  • A new approach to object persistence in PHP – Stefan Priebsch
  • The State of SOAP in PHP – David Zuelke
  • Advanced Date/Time Handling with PHP – Derick Rethans
  • Documents, documents, documents – Matthew Weier O'Phinney

How many of those do you think I want to attend?  2? 3?  How about all of them.  In fact, out of 60-ish or so (I only kinda counted them), there are only a small handful that I could afford to miss.  I've been at Zend for over 4 years now and have been to as many Zendcons and I don't recall being as excited about our list of talks as I am this year.

But it's not just topics, but also partners, customers and vendors who are talking.  Sometimes people think of these as "marketing" talks, and, as such, worth ignoring.  But we've got talks by Ryan Stewart at Adobe, who knows his stuff. Josh Holmes, who knows his stuff (and is bringing brownies…. for real…. actual brownies).  I've not met Jeff Kibler from InfoBright, but I know what InfoBright does and it's pretty cool.  We've also got VMWare, PHPStorm and Oracle giving presentations as well.  I can't speak for all of those talks but these seem to be TECHNICAL talks and not just stuff from the Marketing Slime… (I'm in Zend's Marketing dep't).

We've got seriously good content which should make for a seriously good Zendcon for 2010.  If you haven't registered by now you need to get your butt in gear!

You want to do WHAT with PHP? GIVEAWAY

I just got my copies of my book "You want to do WHAT with PHP?" today.  During my conversations with MCPress, my publisher, I had asked for 3 copies to do a social media promotion and they agreed.  I posted that I would be giving away 3 copies on Twitter and got a whole bunch of "I WANTS".  So I asked my publisher for more copies to give away and they agreed to another 6. So that is a total of 9 copies I have avaialble to give away.

Now the problem I have is; how do I give them away.  So here's what I'm thinking.  First of all, I'd like to open it up to everyone around the world.  But shipping 9 copies of a book to Timbuktu can get expensive, so I will ask that anybody who wins be willing to pay for shipping from my address in the U.S. to the address where you want to receive it.  I believe it will fit into a USPS international mail envelope which looks like it costs $13US to ship anywhere in the world (I tried the UK, India and China and all came up as $13).  So it doesn't look horribly unreasonable.  If the actual shipping costs end up being more I'll give you the option of deciding.

So, with 9 books I'm thinking of splitting it into 3 categories with 3 winners each.  I would split up the winners over the course of three weeks, announcing the winners on each Friday (or thereabouts).  The standard exclusions would apply; family, friends, coworkers (sorry all you Zenders!).  The categories would be:

1) User groups libraries.  What I would do is have the user group leaders submit their group to me via Twitter, Facebook or email.  I would have to verify that it is an actual user group and so I would check it against the list that Zend maintains.  I, technically, manage that list so if you want your user group on it contact me now. 

2) Twitterers.  I will have a blog post that, for you to enter, all you would need to do is retweet the link to the page that I post (and be willing to pay for shipping).

3) Facebookers.  I have a fan page for the book.  I would choose 3 random "Likers" from that page to win a copy of the book.  To win, just "Like" the page and be willing to pay postage.

How does that sound?  If you think it's dumb feel free to make alternate suggestions in the comments.

UPDATED: I would also be willing to accept PayPal to cover shipping charges

UPDATE #2: My twitter handle is kpschrade

Your favorite PHP sites (based off of Facebook responses)

Earlier today I had asked on the Zend Facebook page “what is your favorite page for getting PHP-based information?”  There were some good answers there so I figured that I would post those answers here (since it’s all public information anyways).

 

PHP 5.3 Certification Beta Testers Needed

Zend has recently teamed up with several of the top people in the PHP community to offer the PHP 5.3 Certification.  It will be coming out in a few months, but before we can do that we need beta testers.  That means YOU!  If you want to participate all you need to do is fill out a quick qualification survey.  Everyone who takes the survey can take the final certification at a discounted rate!  Even if you aren't chosen for the beta!  These are the questions you will be asked (fill them out on the link, not on this page).

The survey will be open until July 15th.

ALSO, please Stumble, Digg, Like and Retweet this page so we can get lots of beta testers.

* Please rate your overall PHP experience level:

 
None
 
Just exploring PHP
 
Have done some programmnig in PHP
 
I use PHP extensively
 
I have a PHP certification
 

2
* Please rate your experience specifically with PHP 5.3:

 
None
 
Just exploring PHP 5.3
 
Have done some programming in PHP 5.3
 
I use PHP 5.3 extensively including all the new capabilities
 

3
* Which PHP versions have you used?

 
PHP 4.x
 
PHP 5.0
 
PHP 5.1
 
PHP 5.2
 
PHP 5.3
 

4
* What percentage of your day requires you to use PHP?

 
Up to 25%
 
Up to 50%
 
Up to 75%
 
100%
 

5
* What best describes your role:

 
Programmer / Engineer
 
Technical Manager / Team Lead
 
Non-technical Manager
 
Student
 
Other, please specify

Why I don’t think type-hinted foreach loops are a good idea

There was a Twitter poll going around this morning that I thought was kind of interesting and got me thinking.  It asked whether or not type-hinting in a foreach loop would be a good idea.  The argument was that the same arguments that go for have type hinting in functions/methods apply to loops.  Those reasons would primarily be structure.  Having a more rigid structure means that the likelihood of a runtime error is lessened to a much greater degree.  I agree with this statement, but I don't think that it applies to loops.  And here's why.

The structure argument makes complete sense in the function/method definition.  That is because an individual function has a defined unit of functionality.  Therefore, requiring a certain type of data may  be necessary to implement that specific piece of functionality.

However, this is not the same with a loop.  The only purpose of a loop is to iterate over data.  The example given is

foreach($array as $key => MyClass $a)

I am assuming that when you iterate over the array that if an array item is not an instance of MyClass that PHP would fail in the same way that it does when you run into a function with a different declaration.  Besides the fact that an array is a generic data structure, what happens if this failure occurs during a series of database inserts or updates?  Or a series of web service calls?  IMHO, a loop is a generic structure that does one thing: iteration.

That said, there is actually a construct that I would be open to.

foreach(MyCollectionClass $array as $key => $a)

Then you could have code like this

class MyClass {}

class MyCollectionClass extends ArrayIterator
{
    public function append($value)
    {
       if (!$value instanceof MyClass) {
           throw new Exception("Invalid class added to collection");
       }
       parent::append($value);
    }

    public function offsetSet($index, $newval)
    {
        if (!$newval instanceof MyClass) {
           throw new Exception("Invalid class added to collection");
       }
       parent::offsetSet($index, $newval);
    }
}

What this does is enforce typing prior to the loop iteration and protects against invalid data in the loop.  But this could just as easily be written

if ($array instanceof MyCollectionClass) {
    foreach( $array as $key => $a) {
    }
}

What do you think?

Why you should be careful with phpinfo

I recently posted an image on why you shouldn’t put phpinfo() calls in your code.

There were a couple of comments from people asking “why not?”

Here’s why not.

  1. Go to Google
  2. Search for inurl:phpinfo
  3. Check out the results

At the time of writing there were 4 pages on the first result page that were broadcasting their settings.

Here’s another fun one.  Search for “inurl:phpinfo root”.  Lots more.

There’s a bunch of information that you will see.

  1. PHP Version (which you can then check against for security vulnerabilites) – You’d be surprised how many PHP 4.3 installations there are out there.
  2. Which extensions are loaded (which may also have vulnerabilities)
  3. Where all of the website files are
  4. The username of the web server.  The second search will show up some scaring results.
  5. And much, much more!
Web Analytics