Issue #3240945 by javivf, simon.mellerin: Invalidate function throws error on str_replace() using PHP8