From 829d3075f787569e1471726c6cf0110fdefa0c6a Mon Sep 17 00:00:00 2001 From: Rob Lourens Date: Wed, 7 Jun 2017 11:37:45 -0700 Subject: [PATCH] Improve strStartsWith --- src/utils.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils.php b/src/utils.php index c8df000..04553ce 100644 --- a/src/utils.php +++ b/src/utils.php @@ -174,5 +174,5 @@ function getVendorDir(\stdClass $composerJson = null): string function strStartsWith(string $haystack, string $prefix): bool { - return empty($prefix) || strpos($haystack, $prefix) === 0; + return substr($haystack, 0, strlen($prefix)) === $prefix; }