Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 295524

Replace substr($a, 0, $i) with str_starts_with()

$
0
0

Problem/Motivation

Part of #3324560: Replace strpos/substr with PHP 8's str_starts_with() / str_contains() / str_ends_with().

Proposed resolution

  1. Replace most substr($a, 0, $i) == $b with str_starts_with($b).
  2. A few are deliberately omitted where they would cause merge conflicts with other child issues.

Remaining tasks

  • When reviewing, consider using git diff --color-words or git diff --porecelain.
  • Pay attention to the fact that $i should be the length of $b.

User interface changes

N/A

API changes

N/A

Data model changes

N/A

Release notes snippet

N/A


Viewing all articles
Browse latest Browse all 295524

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>