Fixes #94

Fixes #94
@liviucmg Why not just return the value, when it was found? This would make the code a little slimer, as you don't need the extra "break".
For instance 

    else
    {
        $value = null;
        break;
    }

could be reduced to just

    break;

without any else.