Calendar

February 2012
S M T W T F S
« Jan    
 1234
567891011
12131415161718
19202122232425
26272829  

Tags

The Perils of Foreach

The Perils of Foreach, or “I’ve got yer references dangling right here!”

Here’s another one of those pitfalls in PHP that might be classified as a neophyte mistake, but nevertheless it bit me in the ass a while ago. I was perplexed at first why this one test I had written kept failing, and finally it boiled down to the way I was iterating through an array multiple times in the same block of code. As it turned out, I had made the mistake of leaving a reference to a variable hanging around after I was done with it. Later, in …

Read full post: The Perils of Foreach

The Trouble With Floats, and not the Root Beer Kind

This post is about float values, some basic computer science, and the PHP-specific handling of floats. It’s geared for the beginner, but please read on even if you feel you’re above it, as I tried to include some interesting bits at the end.

As a programmer, I have read through more fat books than I care to think about. That doesn’t mean I’ve retained it – quite the opposite. I’ve probably forgotten at least ten facts for any one I remember. That said, there are times when I’m working on something that I have that “Oh yeahhhh… a-Dur! *self thwap*” moment …

Read full post: The Trouble With Floats, and not the Root Beer Kind