FluidTYPO3 / vhs

TYPO3 extension VHS: Fluid ViewHelpers
https://fluidtypo3.org
Other
189 stars 228 forks source link

PHP 7.3.0 deprecated behavior #1692

Closed ghanshyamgohel closed 3 years ago

ghanshyamgohel commented 3 years ago

If needle is not a string, it is converted to an integer and applied as the ordinal value of a character. This behavior is deprecated as of PHP 7.3.0, and relying on it is highly discouraged. Depending on the intended behavior, the needle should either be explicitly cast to string, or an explicit call to chr() should be performed.

dmitryd commented 3 years ago

I am wondering when it can be something else. It is supposed to be a string always...

NamelessCoder commented 3 years ago

I am wondering when it can be something else. It is supposed to be a string always...

Fluid detects numeric values and creates a NumericNode which can contain integer/float, and if passing a variable reference it may also resolve to null or even objects.

@ghanshyamgohel Pre-approved but would you mind switching it to cast (string) $arg instead of strval and applying the same casting to the haystack as well?

ghanshyamgohel commented 3 years ago

@NamelessCoder Thank you for Pre-approved. I have changed strval to (string)