@@ -124,7 +124,7 @@ private function formatPhoneNumber(string $phoneNumber, string $country): string
124
124
}
125
125
126
126
// Prepend starting notation for supported local numbers
127
- if ($ phoneLength === 10 && ! str_starts_with ($ phoneNumber , $ startingNotation )) {
127
+ if ($ phoneLength === 10 && strpos ($ phoneNumber , $ startingNotation ) !== 0 ) {
128
128
$ phoneNumber = $ startingNotation . substr ($ phoneNumber , 1 );
129
129
}
130
130
@@ -141,7 +141,7 @@ private function formatPhoneNumber(string $phoneNumber, string $country): string
141
141
private function isMobileNumber (string $ phoneNumber , string $ country ): bool
142
142
{
143
143
foreach (self ::VALID_MOBILE [$ country ] ?? [] as $ prefix ) {
144
- if (str_starts_with ($ phoneNumber , $ prefix )) {
144
+ if (strpos ($ phoneNumber , $ prefix ) === 0 ) {
145
145
return true ;
146
146
}
147
147
}
@@ -158,7 +158,7 @@ private function isMobileNumber(string $phoneNumber, string $country): bool
158
158
private function applyInvalidNotationCorrection (string $ phoneNumber , string $ country ): string
159
159
{
160
160
foreach (self ::INVALID_NOTATION [$ country ] ?? [] as $ invalidPrefix ) {
161
- if (str_starts_with ($ phoneNumber , $ invalidPrefix )) {
161
+ if (strpos ($ phoneNumber , $ invalidPrefix ) === 0 ) {
162
162
$ phoneNumber = $ this ->replaceInvalidNotation ($ phoneNumber , $ invalidPrefix , $ country );
163
163
}
164
164
}
0 commit comments