for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Part of SplTypes package.
*
* (c) Adrien Loyant <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Ducks\Component\SplTypes\Tests\benchmark;
use Ducks\Component\SplTypes\SplString as DuckString;
class SplStringBench
{
* @Revs(1000)
* @Iterations(5)
* @return void
public function benchCreateEmpty(): void
new DuckString();
}
public function benchCreateTest(): void
new DuckString('test');
public function benchCreateNumeric(): void
new DuckString((string) mt_rand());
* @psalm-suppress UnsupportedReferenceUsage
public function benchConcatenate(): void
$string = new DuckString('hello ');
$value = &$string();
$value .= 'world';
$result = $value;
unset($result);