Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report

symfony/polyfill-util v1.29.0

Symfony utilities for portability of PHP codes
Package summary
Share
0
issues
0
licenses
Package created
25 Oct 2015
Version published
29 Jan 2024
Maintainers
1
Total deps
0
Direct deps
0
License
MIT
Generating a report...
Hold on while we generate a fresh audit report for this package.

Frequently Asked Questions

What does symfony/polyfill-util do?

Symfony's polyfill-util is a valuable tool in the world of PHP development. It facilitates portability of PHP codes by providing binary-safe string functions. This is achieved using the mbstring extension when available, optimizing your PHP operations and ensuring consistency even across different environments.

How do you use symfony/polyfill-util?

Using symfony/polyfill-util is straightforward. The package is easily installed into your project via Composer, a tool for dependency management in PHP. You can include this package in your project with the following command in your terminal:

composer require symfony/polyfill-util

After installation, the functions provided by this utility can be used in your PHP code like any native function. Here’s an example, assuming mbstring extension is not enabled in your server:

use Symfony\Polyfill\Mbstring;

$string = 'Hello, World!';
$length = Mbstring::mb_strlen($string);

echo $length; // Outputs: 13

In the above code, we have used the mb_strlen() function provided by the Mbstring class of the symfony/polyfill-util package to get the length of the $string.

Where are the symfony/polyfill-util docs?

For more detail on symfony/polyfill-util, its main functionality and how to use it, you can refer to the main Symfony Polyfill README documentation available on GitHub. This comprehensive document provides in-depth information and additional usage details for the symfony/polyfill-util package, enabling you to utilize its features effectively. The documentation can be found here.