Is preq_match supposed to return true for testing nothing on something?
$needle = "";
$haystack = "test";
$result = preg_match("/" . $needle . "/i", $haystack);
I would expect $result
to be 0
, but it's 1
.
Logically speaking, testing nothing on something should yield nothing ... how does the song go? Nothing from something leaves nothing ... got to have something ... if you want to be with me!.
I didn't want to have to pretest to make sure nothing was something before I tested nothing against something :-). Hmm ... I don't think I could be more confusing if I tried.