Archive for the ‘Core Library’ Category

My purity you stole

Thursday, January 14th, 2010

Yesterday, I wrote about how $f() variable-function syntax works in PHP. While it is pretty bad, it’s also the groundwork for understanding the ways in which create_function is terrible.

No, I mean besides taking a string full of code as one of its arguments.

(more…)

God Money, I’ll do anything for you

Friday, January 8th, 2010

The loop

1
2
3
4
5
< ?php
while ($read < $n && (false !== ($buf = fread($this->sock, $n - $read)))) {
    /* ... */
}
?>

contains a subtle bug. Go ahead, read the relevant function documentation and see if you can spot it.

(more…)