I have a list of values I have to check my input against it for existence.
What is the faster way?
This is really out of curiosity on how the internals work, not any stuff about premature optimization etc...
1.
$x=array('v'=>'','c'=>'','w'=>);
..
..
array_key_exists($input,$x);
2.
$x=array('v','c','w');
..
..
in_array($input,$x);