Closed (fixed)
Project:
Drupal core
Version:
9.3.x-dev
Component:
base system
Priority:
Critical
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
26 Sep 2021 at 13:46 UTC
Updated:
11 Oct 2021 at 08:54 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
alexpottWe use both 0 and -1 to mean limitless in core code. Going with -1 here since it is the default value and feels better to me to mean without limit.
Comment #3
daffie commentedIn #3238941: \Drupal\big_pipe\Render\BigPipe::splitHtmlOnPlaceholders() causes deprecation errors on PHP 8.1 we went with the default value of 0. What shall we use for the default value when 0 and -1 do the same thing? I can live with either one.
Comment #4
alexpottAs stated in #2 I believe that choice made in #3238941: \Drupal\big_pipe\Render\BigPipe::splitHtmlOnPlaceholders() causes deprecation errors on PHP 8.1 was wrong - but core already has plenty of examples of both 0 and -1.
Comment #5
alexpottAlso #3238941: \Drupal\big_pipe\Render\BigPipe::splitHtmlOnPlaceholders() causes deprecation errors on PHP 8.1 should have included these fixes and a check of what default core was already using.
Here is the result of
grep -ER "preg_split.*(0|-1)" ./coreThere are 4 zeros and 10 instances of -1 ...
Comment #6
andypostI think the patch fixing current issue so -1 is good common case, not sure it makes sense to unify this calls everywhere (could use follow-up)
Comment #8
catchNot sure it's worth trying to unify 0 vs. -1, if we really want to, would probably lean towards -1 given it's the default.
Committed b8561b8 and pushed to 9.3.x. Thanks!