a breakpoint is a debugging process for halting code execution and allowing the developer to examine the state of the various variables etc at that time. frequently the debugger then allows line by line execution.
PHP is not naturally debug aware. there are a couple of debugging extensions to IDE's around (like Zend and xDebug). I have not found either of the quoted examples very useful.
you can 'emulate' breakpoints by footprinting your code with debug statements which dump the variables you are interested in to the screen or to a text file etc. If you _really_ want code to halt thereafter you can use exit() or die(). this is how , I believe, most developers debug their applications in php.
unit testing is also related to debugging but, imo, further down the chain towards release. For unit testing you break down your code to individual functions, methods etc and provide each of the components with a known input, where you already know the expected output. you then compare the two.
the two things you mention are complementary. You will always debug using breakpoints or visualisations for just about every application you write. Unit tests, in their formalised sense, I would not expect you to use for simple applications and even for complex variants, I would say that they are most useful in regression testing (making sure that a new version of your code is not being broken by some older libraries/functions/methods.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.