wrap($arrays->arrayOf($plugins->loadClass("java.lang.String"), "hello", "world", "kotlin", "android")); // 按单词长度分组 $wordsByLength = $words->groupBy((function ($it) use ($objectWrappers) { return $objectWrappers->wrap($it)->count(); }), function ($it) { return $it; }); // 输出:按长度分组的单词: {5=[hello, world], 6=[kotlin], 7=[android]}) $console->log("按长度分组的单词: ", $wordsByLength);