Skip to content

Various compatibility changes #32

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Dec 12, 2023
Merged

Various compatibility changes #32

merged 5 commits into from
Dec 12, 2023

Conversation

rkrx
Copy link
Contributor

@rkrx rkrx commented Dec 12, 2023

  • The rand() function, which generates a pseudo-random number, is replaced with the random_int() function in the random.php file. The random_int() function is a cryptographically secure function introduced in PHP7 that generates a random integer.
  • In truncate.php and castSlice.php, the null coalescing operator (??) is used. This operator checks if the variable on its left-hand side is set and not null, and if so, it returns its own value; otherwise, it returns the value of the variable on the right-hand side.
  • The function baseMatches.php now uses is_iterable(), a function introduced in PHP 7.1, to check if a variable is an array or a traversable object instead of the combination of is_array() and instanceof Traversable.
  • In template.php, string interpolation is updated to comply with the latest standards, due to a PHP deprecation warning against the use of ${var} syntax. Instead, {$var} syntax is used for variable parsing within a string.

@pierredup pierredup self-assigned this Dec 12, 2023
@pierredup pierredup added this to the stable milestone Dec 12, 2023
@pierredup
Copy link
Member

Thank you @rkrx

@pierredup pierredup merged commit fece318 into lodash-php:master Dec 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants