Skip to content

Commit

Permalink
bug #1000 fix: Replace str_starts_with by strncmp (PHP7 compatibility…
Browse files Browse the repository at this point in the history
…) (PROFeNoM)

This PR was merged into the 1.x branch.

Discussion
----------

fix: Replace str_starts_with by strncmp (PHP7 compatibility)

Hi 👋

The [v1.21.0](https://github.com/symfony/flex/releases/tag/v1.21.0) tag release made a few hours ago started breaking compatibility with PHP7 because of the use of `str_starts_with`.

This PR replaces `str_starts_with` by `strncmp`, as suggested by the [rfc](https://wiki.php.net/rfc/add_str_starts_with_and_ends_with_functions) 😃

Commits
-------

07e35fa fix: Replace str_starts_with by strncmp (PHP7 compatibility)
  • Loading branch information
fabpot committed Oct 24, 2023
2 parents 5529871 + 07e35fa commit 7c191ea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Configurator/DockerComposeConfigurator.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ private function normalizeConfig(array $config): array
return ['compose.yaml' => $config];
}

if (!str_starts_with($key, 'docker-')) {
if (strncmp($key, 'docker-', 7)) {
continue;
}

Expand Down

0 comments on commit 7c191ea

Please sign in to comment.