Supported Versions: PHP 4 >= 4.1.0, PHP 5, PHP 7, PHP 8
Return a formatted string
<?php vsprintf(string $format, array $values): string
<?php         $column = str_replace('->>', '->', $this->wrap(implode('->', $segments)));



        if (isset($i)) {

            return vsprintf('case when %s then %s else false end', [

                'jsonb_typeof(('.$column.")::jsonb) = 'array'",

                'jsonb_array_length(('.$column.')::jsonb) >= '.($i < 0 ? abs($i) : $i + 1),

            ]);

        }



        $key = "'".str_replace("'", "''", $lastSegment)."'";
<?php         );



        return preg_replace(

            vsprintf('/use %s;[\r\n]+use %s;/', [

                preg_quote($namespacedModel, '/'),

                preg_quote($namespacedModel, '/'),

            ]),

            "use {$namespacedModel};",

            $stub

        );
<?php                 PHPUnit::assertTrue(

                    $expected->shouldNotSleep()->duration->equalTo($actual),

                    vsprintf('Expected sleep duration of [%s] but actually slept for [%s].', [

                        $expected->duration->cascade()->forHumans([

                            'options' => 0,

                            'minimumUnit' => 'microsecond',

                        ]),

                        $actual->cascade()->forHumans([

                            'options' => 0,

                            'minimumUnit' => 'microsecond',

                        ]),

                    ])

                );

            });

    }
<?php         }



        foreach (static::$sequence as $duration) {

            PHPUnit::assertSame(0, (int) $duration->totalMicroseconds, vsprintf('Unexpected sleep duration of [%s] found.', [

                $duration->cascade()->forHumans([

                    'options' => 0,

                    'minimumUnit' => 'microsecond',

                ]),

            ]));

        }

    }
<?php     protected function replaceAsterisksInParameters(array $parameters, array $keys)

    {

        return array_map(function ($field) use ($keys) {

            return vsprintf(str_replace('*', '%s', $field), $keys);

        }, $parameters);

    }
<?php         $builder = $model->withCount('children');



        $this->assertSame(vsprintf('select "table".*, (select count(*) from "table" as "%s" where "table"."id" = "%s"."parent_id" and "enum_value" = ?) as "children_count" from "table"', [$relationHash, $relationHash]), $builder->toSql());

    }



    public function testWithExists()