src/Arr.php
public static function objectsMethodValues(array $objectArray, string $methodName): array
    {
        $methodValues = [];

        foreach ($objectArray as $object) {
            $methodValues[] = $object->$methodName();
        }

        return $methodValues;
    }
public static function objectsMethodValues(array $objectArray, string $methodName): array
    {
        $methodValues = [];

        foreach ($objectArray as $object) {
            $methodValues[] = $object->$methodName();
        }

        return $methodValues;
    }
public static function objectsMethodValues ( array $ objectArray , string $ methodName ) : array { $ methodValues = [ ] ; foreach ( $ objectArray as $ object ) { $ methodValues [ ] = $ object -> $ methodName ( ) ; } return $ methodValues ; }
Collect values from method calls from an array of objects.

@param array  $objectArray
@param string $methodName
@return array
Collect values from method calls from an array of objects .