Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

How fast can you spot PHP Bugs?

DZone's Guide to

How fast can you spot PHP Bugs?

· Web Dev Zone ·
Free Resource

Bugsnag monitors application stability, so you can make data-driven decisions on whether you should be building new features, or fixing bugs. Learn more.

Blake over at PHP vs .NET has written up a very nice article to prepare those who are interviewing for a php job soon. He basically gives a bunch of php snippets and asks where the bugs are. The article somewhat morphs into a mish-mash of good-practice/bad-practice comparison and explains why one way is better than the other.

From the article:

Find the errors in the following code:

<?php
function baz($y $z) {
    $x = new Array();
    $x[sales]  = 60;
    $x[profit] = 20:

    foreach($x as $key = $value) {
        echo $key+" \"+$value+\"<BR>\";
    }
} 
?> 

 

Monitor application stability with Bugsnag to decide if your engineering team should be building new features on your roadmap or fixing bugs to stabilize your application.Try it free.

Topics:

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}