You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 12, 2020. It is now read-only.
function test()
{
$userHelper = [1,2];
unset($options[0]);
}
Refactoring the secound line in the function will fail to take account for the unsetting changing $options and it needing to be retuned or passed by reference.
function test()
{
$options = [1,2];
$this->asd($options);
}
private function asd($options)
{
unset($options[0]);
}
expected
function test()
{
$options = [1,2];
$options = $this->asd($options);
}
private function asd($options)
{
unset($options[0]);
return $options;
}