ArrayObject does not work with end() in PHP 7.4
From PHP 7.4 array methods don't operate on internal array, but on ArrayObject
itself. I summarized two solutions for that.
1. Getting internal array of object.
$array = new \ArrayObject(["a", "b"]);
$item = end($array->getArrayCopy());
2. Creating Facade of ArrayObject
and adding custom method end() to upgraded class.