Substr is actually slower, even if the HTTP_ is not present on the string (see below), probably because strpos just iterate on the string, and substr have to allocate new memory, allocating memory is expensive. The only way substr would be faster than strpos is if key is HUGE size.

```
php > $key = 'HTTP_asddddddddddddddddddddddddddddddssasffadssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssdassssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssfadsdddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd';
php > $start = microtime(true); for ($i = 1; $i <= 5000000; ++$i) { (0 === strpos($key, 'NOTF_')); } var_dump(microtime(true) - $start);   double(3.2372899055481)
php > $start = microtime(true); for ($i = 1; $i <= 5000000; ++$i) { ('HTTP_' === substr($key,0,5)); } var_dump(microtime(true) - $start);   double(3.6791360378265)
```