Skip to content

Rewrite your app in Rust, piece by piece, checked against the original at every step. Works with TypeScript, JavaScript, Python, Go, Ruby, Java, C, PHP, C#, Kotlin, PowerShell and Swift.

234 B
Raw Blame
<?php

declare(strict_types=1);

namespace Acme\Clash;

final class Arr
{
    public static function length(string $s): int
    {
        return count(array_filter(explode(' ', $s), static fn (string $w): bool => $w !== ''));
    }
}