symfony/polyfill-util
A small Symfony utility polyfill that provides shared helper classes and functions used by other Symfony polyfill packages. It is not intended for direct use; include it when a polyfill depends on it to support compatibility across PHP versions.
Architecture fit. symfony/polyfill-util is not an application-layer library; it is infrastructure plumbing. It ships small helper classes (notably BinaryOnMac and LegacyPasswordHash, plus version-gate helpers) that other Symfony polyfills use internally to decide whether a native PHP function is available and whether a shim can be safely bootstrapped. In a Laravel codebase it lives entirely under vendor/, is autoloaded by Composer, and is essentially never called by application or domain code. Its architectural fit is therefore "invisible transitive dependency," not "feature we build on." A TPM should classify it as platform substrate, not as a package the team adopts.
Integration feasibility. Integration cost is effectively zero: no service provider, no config publishing, no facade, no migrations, no environment variables. It resolves automatically when a sibling polyfill declares it. A direct composer require is technically trivial but strategically discouraged unless we genuinely consume its API — which is rare and usually a sign we are compensating for a PHP floor we should simply raise.
Technical risk. Runtime risk is low: pure PHP, no extensions, MIT-licensed, widely mirrored. Governance risk is moderate and is the real story. Three data-quality flags deserve scrutiny before this goes into an SBOM: the repository field is unknown, which breaks provenance and provenance-based vulnerability triage; the listed last release (2026-09-30) is future-dated relative to any normal audit window and must be reconciled against Packagist; and the composite score (≈25) signals a package that is present by inertia rather than active investment. Substantively, Symfony has been progressively dropping polyfill-util from its own polyfill dependency graphs, so this is a legacy shim retained for backward compatibility. Depending on it directly is depending on a package the ecosystem is walking away from.
Key questions.
composer why symfony/polyfill-util)str_contains, get_debug_type, fdiv, native password_hash behavior)?Stack fit. Composer-native and framework-agnostic; Laravel compatibility is inherited from the PHP version floor rather than from any Laravel-specific integration. It coexists cleanly with Laravel's autoloader and with the polyfill family Laravel already pulls in (polyfill-php80/81/83, polyfill-mbstring, polyfill-intl-*, polyfill-ctype).
Migration path. Treat this as a contain-and-retire exercise, not an adoption:
composer why, composer show --tree, and generate an SBOM to establish direct vs. transitive status.composer.lock, and forbid first-party imports via a static-analysis or code-review rule.config.platform.php floor and CI matrix reach a version where the dependent polyfills no longer request it; regenerate the lockfile and confirm the tree shrinks.Compatibility. Pure PHP with no extension requirements; safe on PHP 8.x; no known conflicts with Laravel's service container or with other Symfony components. Verify behavior under Octane: the helpers should be stateless, but "should be" is not "is," and long-running workers punish static accumulation.
Sequencing. Inventory → pin and allowlist → add CI guards (composer audit, SBOM diff, lockfile-drift check) → refactor any direct usage → drop the dependency when the PHP floor permits. Do the pinning before the refactor so the build is deterministic while work proceeds, and do the removal after the CI guard is in place so it cannot silently reappear.
Maintenance. Near-zero hands-on maintenance: no configuration, no scheduled jobs, no schema. The real recurring cost is governance — keeping it classified correctly, keeping it out of first-party imports, and reviewing it at each dependency-review cycle. Version cadence follows Symfony's release train, so churn is low and predictable.
Support. MIT-licensed, community-supported, no commercial SLA and no vendor escalation path. Support is GitHub issues only — which is precisely why the unknown repository field matters: we cannot confidently name the canonical upstream, cannot subscribe to its advisories by URL, and cannot assert provenance during an incident review. Resolve that before the package is treated as trusted.
Scaling. No measurable throughput, memory, or latency cost. Class loading occurs only when a polyfill bootstrap path executes, which is startup-adjacent and effectively free at request scale. Under Octane, confirm no per-request mutable static state persists across worker iterations.
Failure modes.
polyfill-util API that shifted, producing a fatal on bootstrap rather than a graceful degradation.config.platform.php disagreeing with the real runtime selects the wrong polyfill branch, causing behavior that differs between CI and production.Ramp-up. Roughly fifteen minutes for a mid-level engineer to understand what it does and why it is there. The onboarding note should be one line: do not import it, do not call it, treat it as transitive, and raise the PHP floor rather than reaching for it. Budget more effort for the governance conversation — SBOM ownership, allowlist policy, and the PHP-floor roadmap — than for the code itself.
How can I help you explore Laravel packages today?