Skip to content

Instantly share code, notes, and snippets.

View sebastianbergmann's full-sized avatar

Sebastian Bergmann sebastianbergmann

View GitHub Profile
<?php declare(strict_types=1);
function mb_sprintf($format, ...$args): string
{
$params = $args;
return sprintf(
preg_replace_callback(
'/(?<=%|%-)\d+(?=s)/',
static function ($length) use (&$params) {
$value = array_shift($params);