hundreds-zoo-67664
11/17/2022, 12:46 PMnumerous-umbrella-61726
11/17/2022, 12:57 PMhundreds-zoo-67664
11/18/2022, 7:48 AM/**
* Sets value based on offset.
*
* @param int|null $offset Offset
* @param mixed $value Value to be set
*
* @return void
*/
public function offsetSet($offset, $value)
{
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
Should be:
/**
* Sets value based on offset.
*
* @param int|null $offset Offset
* @param mixed $value Value to be set
*
* @return void
*/
#[\ReturnTypeWillChange] //Or add return type to the method : void
public function offsetSet($offset, $value)
{
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
hundreds-zoo-67664
11/18/2022, 7:51 AMnumerous-umbrella-61726
11/18/2022, 12:08 PMnumerous-umbrella-61726
11/18/2022, 12:08 PMnumerous-umbrella-61726
11/18/2022, 12:09 PM