Odd PHP problem

The following produces an error:


function hex2rgb($hex)
{
    for($i=0; $i<3; $i++)
    {
        $temp = substr($hex,2*$i,2);
        $rgb[$i] = 16 * hexdec(substr($temp,0,1)) + hexdec(substr($temp,1,1));
    }
    return $rgb;
}

function hex2rgb($hex)
{
    for($i=0; $i<3; $i++)
    {
        $temp = substr($hex,2*$i,2);
        $rgb[$i] = 16 * hexdec(substr($temp,0,1)) + hexdec(substr($temp,1,1));
    }
    return $rgb;
}

But not the error you might expect. PHP doesn’t even get to complain about redeclaring a function with the same name since the second function is full of parse errors.

I have a vague idea what the problem is but I’m not sure. Any takers? :P

Sorry about the dodgy display…